const instrumentationScope … // Start creates spans using both OpenTelemetry, and the k8s.io/utils/trace package. // It only creates an OpenTelemetry span if the incoming context already includes a span. func Start(ctx context.Context, name string, attributes ...attribute.KeyValue) (context.Context, *Span) { … } type Span … // AddEvent adds a point-in-time event with a name and attributes. func (s *Span) AddEvent(name string, attributes ...attribute.KeyValue) { … } // End ends the span, and logs if the span duration is greater than the logThreshold. func (s *Span) End(logThreshold time.Duration) { … } // RecordError will record err as an exception span event for this span. // If this span is not being recorded or err is nil then this method does nothing. func (s *Span) RecordError(err error, attributes ...attribute.KeyValue) { … } func attributesToFields(attributes []attribute.KeyValue) []utiltrace.Field { … } // SpanFromContext returns the *Span from the current context. It is composed of the active // OpenTelemetry and k8s.io/utils/trace spans. func SpanFromContext(ctx context.Context) *Span { … } // ContextWithSpan returns a context with the Span included in the context. func ContextWithSpan(ctx context.Context, s *Span) context.Context { … }