Documentation
¶
Overview ¶
Package opentelemetry provides OpenTelemetry utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultTextMapPropagator = propagation.NewCompositeTextMapPropagator( propagation.TraceContext{}, propagation.Baggage{}, )
DefaultTextMapPropagator is the default OpenTelemetry TextMapPropagator used by this implementation if not otherwise set in TracerOptions.
Functions ¶
func NewTracer ¶
func NewTracer(options TracerOptions) (interceptor.Tracer, error)
NewTracer creates a tracer with the given options. Most callers should use NewTracingInterceptor instead.
func NewTracingInterceptor ¶
func NewTracingInterceptor(options TracerOptions) (interceptor.Interceptor, error)
NewTracingInterceptor creates an interceptor for setting on client options that implements OpenTelemetry tracing for workflows.
Types ¶
type TracerOptions ¶
type TracerOptions struct { // Tracer is the tracer to use. If not set, one is obtained from the global // tracer provider using the name "temporal-sdk-go". Tracer trace.Tracer // DisableSignalTracing can be set to disable signal tracing. DisableSignalTracing bool // DisableQueryTracing can be set to disable query tracing. DisableQueryTracing bool // AllowInvalidParentSpans will swallow errors interpreting parent // spans from headers. Useful when migrating from one tracing library // to another, while workflows/activities may be in progress. AllowInvalidParentSpans bool // TextMapPropagator is the propagator to use for serializing spans. If not // set, this uses DefaultTextMapPropagator, not the OpenTelemetry global one. // To use the OpenTelemetry global one, set this value to the result of the // global call. TextMapPropagator propagation.TextMapPropagator // SpanContextKey is the context key used for internal span tracking (not to // be confused with the context key OpenTelemetry uses internally). If not // set, this defaults to an internal key (recommended). SpanContextKey interface{} // HeaderKey is the Temporal header field key used to serialize spans. If // empty, this defaults to the one used by all SDKs (recommended). HeaderKey string // SpanStarter is a callback to create spans. If not set, this creates normal // OpenTelemetry spans calling Tracer.Start. SpanStarter func(ctx context.Context, t trace.Tracer, spanName string, opts ...trace.SpanStartOption) trace.Span }
TracerOptions are options provided to NewTracingInterceptor or NewTracer.
Click to show internal directories.
Click to hide internal directories.