Documentation
¶
Index ¶
- func SetClientSpan(ctx context.Context, span trace.Span, m interface{})
- func SetServerSpan(ctx context.Context, span trace.Span, m interface{})
- type Metadata
- type Option
- type Tracer
- func (t *Tracer) End(_ context.Context, span trace.Span, err error, attrs ...attribute.KeyValue)
- func (t *Tracer) Inject(ctx context.Context, carrier propagation.TextMapCarrier)
- func (t *Tracer) Start(ctx context.Context, operation string, carrier propagation.TextMapCarrier, ...) (context.Context, trace.Span)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetClientSpan ¶ added in v2.0.6
Types ¶
type Metadata ¶ added in v2.0.6
type Metadata struct{}
Metadata is tracing metadata propagator
func (Metadata) Extract ¶ added in v2.0.6
func (b Metadata) Extract(parent context.Context, carrier propagation.TextMapCarrier) context.Context
Extract returns a copy of parent with the metadata from the carrier added.
func (Metadata) Inject ¶ added in v2.0.6
func (b Metadata) Inject(ctx context.Context, carrier propagation.TextMapCarrier)
Inject sets metadata key-values from ctx into the carrier.
type Option ¶
type Option func(*options)
Option is tracing option.
func WithGlobalPropagator ¶
func WithGlobalPropagator() Option
WithGlobalPropagator set the global TextMapPropagator
func WithGlobalTracerProvider ¶
func WithGlobalTracerProvider() Option
WithGlobalTracerProvider set the registered global trace provider
func WithPropagator ¶
func WithPropagator(propagator propagation.TextMapPropagator) Option
WithPropagator with tracer propagator.
func WithTracerProvider ¶
func WithTracerProvider(provider trace.TracerProvider) Option
WithTracerProvider with tracer provider. By default, it uses the global provider that is set by otel.SetTracerProvider(provider).
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
Tracer is otel span tracer
func (*Tracer) Inject ¶
func (t *Tracer) Inject(ctx context.Context, carrier propagation.TextMapCarrier)
Inject set cross-cutting concerns from the Context into the carrier.
Click to show internal directories.
Click to hide internal directories.