Documentation ¶
Index ¶
- func ContextWithSpan(ctx context.Context, s *Span) context.Context
- func Propagators() propagation.TextMapPropagator
- func WithTracing(handler http.Handler, tp oteltrace.TracerProvider, spanName string) http.Handler
- func WrapperFor(tp oteltrace.TracerProvider) transport.WrapperFunc
- type Span
- type TracerProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithSpan ¶ added in v0.26.0
ContextWithSpan returns a context with the Span included in the context.
func Propagators ¶
func Propagators() propagation.TextMapPropagator
Propagators returns the recommended set of propagators.
func WithTracing ¶
WithTracing adds tracing to requests if the incoming request is sampled
func WrapperFor ¶
func WrapperFor(tp oteltrace.TracerProvider) transport.WrapperFunc
WrapperFor can be used to add tracing to a *rest.Config. Example usage: tp := NewProvider(...) config, _ := rest.InClusterConfig() config.Wrap(WrapperFor(tp)) kubeclient, _ := clientset.NewForConfig(config)
Types ¶
type Span ¶ added in v0.26.0
type Span struct {
// contains filtered or unexported fields
}
Span is a component part of a trace. It represents a single named and timed operation of a workflow being observed. This Span is a combination of an OpenTelemetry and k8s.io/utils/trace span to facilitate the migration to OpenTelemetry.
func SpanFromContext ¶ added in v0.26.0
SpanFromContext returns the *Span from the current context. It is composed of the active OpenTelemetry and k8s.io/utils/trace spans.
func Start ¶ added in v0.26.0
func Start(ctx context.Context, name string, attributes ...attribute.KeyValue) (context.Context, *Span)
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 (*Span) AddEvent ¶ added in v0.26.0
AddEvent adds a point-in-time event with a name and attributes.
type TracerProvider ¶ added in v0.26.0
type TracerProvider interface { oteltrace.TracerProvider Shutdown(context.Context) error }
TracerProvider is an OpenTelemetry TracerProvider which can be shut down
func NewNoopTracerProvider ¶ added in v0.26.0
func NewNoopTracerProvider() TracerProvider
func NewProvider ¶
func NewProvider(ctx context.Context, tracingConfig *v1.TracingConfiguration, addedOpts []otlptracegrpc.Option, resourceOpts []resource.Option, ) (TracerProvider, error)
NewProvider creates a TracerProvider in a component, and enforces recommended tracing behavior