MCPcopy
hub / github.com/containerd/containerd / SetStatus

Method SetStatus

pkg/tracing/tracing.go:101–108  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
101func (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.
111func (s *Span) SetAttributes(kv ...attribute.KeyValue) {

Callers

nothing calls this directly

Calls 3

RecordErrorMethod · 0.80
SetStatusMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected