ot

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

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

func SetSpanStatus(span trace.Span, err error)

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.

func StartSpan

func StartSpan(ctx context.Context, name string, o ...trace.SpanStartOption) (