Documentation
¶
Index ¶
- Constants
- Variables
- func SetSpanStatus(span trace.Span, err error)
- func StartSpan(ctx context.Context, name string, o ...trace.SpanStartOption) (context.Context, trace.Span)
- func StartSpanWithRemoteParent(ctx context.Context, name string, parent trace.SpanContext, ...) (context.Context, trace.Span)
- type LogrusExporter
Constants ¶
View Source
const (
TracerName = "containerd-shim-runhcs-v1"
)
Variables ¶
View Source
var DefaultSampler = sdktrace.AlwaysSample()
View Source
var WithClientSpanKind = trace.WithSpanKind(trace.SpanKindClient)
View Source
var WithServerSpanKind = trace.WithSpanKind(trace.SpanKindServer)
Functions ¶
func SetSpanStatus ¶
SetSpanStatus sets the span's OpenTelemetry status based on `err`.
If `err` is non-nil the error is recorded on the span and the status is set to `codes.Error`.
If `err` is nil the span is left in its default (Unset) status. The exporter treats Unset the same as Ok for level selection (Info), so downstream log level does not change. Leaving the status Unset instead of calling SetStatus(Ok, "") avoids the OpenTelemetry spec's "Ok is terminal" rule, under which a subsequent SetStatus(Error, ...) would be silently dropped.