SetStatus sets the status of the current span. If an error is encountered, it records the error and sets span status to Error.
(err error)
| 99 | // SetStatus sets the status of the current span. |
| 100 | // If an error is encountered, it records the error and sets span status to Error. |
| 101 | func (s *Span) SetStatus(err error) { |
| 102 | if err != nil { |
| 103 | s.otelSpan.RecordError(err) |
| 104 | s.otelSpan.SetStatus(codes.Error, err.Error()) |
| 105 | } else { |
| 106 | s.otelSpan.SetStatus(codes.Ok, "") |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | // SetAttributes sets kv as attributes of the span. |
| 111 | func (s *Span) SetAttributes(kv ...attribute.KeyValue) { |
nothing calls this directly
no test coverage detected