Remove extra span created in the instrumented service layer

Signed-off-by: Swagat Bora <sbora@amazon.com>
This commit is contained in:
Swagat Bora
2023-02-23 22:42:56 +00:00
parent c0cdcb34f1
commit 83c26962c2
3 changed files with 29 additions and 24 deletions

View File

@@ -92,6 +92,11 @@ func (s *Span) AddEvent(name string, attributes ...attribute.KeyValue) {
s.otelSpan.AddEvent(name, trace.WithAttributes(attributes...))
}
// RecordError will record err as an exception span event for this span
func (s *Span) RecordError(err error, options ...trace.EventOption) {
s.otelSpan.RecordError(err, options...)
}
// SetStatus sets the status of the current span.
// If an error is encountered, it records the error and sets span status to Error.
func (s *Span) SetStatus(err error) {