Documentation ¶
Index ¶
- func Error(span trace.Span, err error) error
- func Errorf(span trace.Span, format string, args ...any) error
- func NewProfilingTracerProvider(tp tracerProvider) tracerProvider
- func TraceIDFromContext(ctx context.Context, requireSampled bool) string
- type Tracer
- type TracerForTestOption
- type TracingConfig
- func NewEmptyTracingConfig() *TracingConfig
- func NewJaegerTracingConfig(address string, propagation string) (*TracingConfig, error)
- func NewOTLPTracingConfig(address string, propagation string) (*TracingConfig, error)
- func ParseTracingConfig(cfg *setting.Cfg) (*TracingConfig, error)
- func ProvideTracingConfig(cfg *setting.Cfg) (*TracingConfig, error)
- type TracingService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Error ¶
Error sets the status to error and record the error as an exception in the provided span.
func Errorf ¶
Errorf wraps fmt.Errorf and also sets the status to error and record the error as an exception in the provided span.
func NewProfilingTracerProvider ¶
func NewProfilingTracerProvider(tp tracerProvider) tracerProvider
NewProfilingTracerProvider creates a new tracer provider that annotates pprof samples with span_id label. This allows to establish a relationship between pprof profiles and reported tracing spans.
Types ¶
type Tracer ¶
type Tracer interface { trace.Tracer // Inject adds identifying information for the span to the // headers defined in [http.Header] map (this mutates http.Header). // // Implementation quirk: Where OpenTelemetry is used, the [Span] is // picked up from [context.Context] and for OpenTracing the // information passed as [Span] is preferred. // Both the context and span must be derived from the same call to // [Tracer.Start]. Inject(context.Context, http.Header, trace.Span) }
Tracer defines the service used to create new spans.
func InitializeTracerForTest ¶
func InitializeTracerForTest(opts ...TracerForTestOption) Tracer
type TracerForTestOption ¶
type TracerForTestOption func(tp *tracesdk.TracerProvider)
func WithSpanProcessor ¶
func WithSpanProcessor(sp tracesdk.SpanProcessor) TracerForTestOption
type TracingConfig ¶
type TracingConfig struct { Address string Propagation string CustomAttribs []attribute.KeyValue Sampler string SamplerParam float64 SamplerRemoteURL string ServiceName string ServiceVersion string // contains filtered or unexported fields }
func NewEmptyTracingConfig ¶
func NewEmptyTracingConfig() *TracingConfig
func NewJaegerTracingConfig ¶
func NewJaegerTracingConfig(address string, propagation string) (*TracingConfig, error)
func NewOTLPTracingConfig ¶
func NewOTLPTracingConfig(address string, propagation string) (*TracingConfig, error)
func ParseTracingConfig ¶
func ParseTracingConfig(cfg *setting.Cfg) (*TracingConfig, error)
func ProvideTracingConfig ¶
func ProvideTracingConfig(cfg *setting.Cfg) (*TracingConfig, error)
func (TracingConfig) OTelExporterEnabled ¶
func (tc TracingConfig) OTelExporterEnabled() bool
type TracingService ¶
func ProvideService ¶
func ProvideService(tracingCfg *TracingConfig) (*TracingService, error)
func (*TracingService) GetTracerProvider ¶
func (ots *TracingService) GetTracerProvider() tracerProvider
func (*TracingService) OtelTracer ¶
func (ots *TracingService) OtelTracer() trace.Tracer
Click to show internal directories.
Click to hide internal directories.