Documentation ¶
Index ¶
- func InitTracer(appName, endpoint string, probability float64) (oteltrace.Tracer, func(context.Context))
- func NewSpan(ctx context.Context, spanName string, opts ...oteltrace.SpanStartOption) (context.Context, oteltrace.Span)
- func NewSpanFromContext(ctx, sctx context.Context, spanName string, opts ...oteltrace.SpanStartOption) (context.Context, oteltrace.Span)
- func NewSpanFromSpanContext(ctx context.Context, spCtx oteltrace.SpanContext, spanName string, ...) (context.Context, oteltrace.Span)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitTracer ¶
func InitTracer(appName, endpoint string, probability float64) (oteltrace.Tracer, func(context.Context))
InitTracer returns the configured OTEL tracer.
func NewSpan ¶
func NewSpan(ctx context.Context, spanName string, opts ...oteltrace.SpanStartOption) (context.Context, oteltrace.Span)
NewSpan is a wrapper for tracer.NewSpan(ctx, spanName, opts). If the context.Context provided in `ctx` contains a Span then the newly-created Span will be a child of that span, otherwise it will be a root span. Don't forget to defer span.End and use the newly provided context.
func NewSpanFromContext ¶
func NewSpanFromContext(ctx, sctx context.Context, spanName string, opts ...oteltrace.SpanStartOption) (context.Context, oteltrace.Span)
NewSpanFromContext is like NewSpanFromSpanContext but uses a span from a context to work
func NewSpanFromSpanContext ¶
func NewSpanFromSpanContext(ctx context.Context, spCtx oteltrace.SpanContext, spanName string, opts ...oteltrace.SpanStartOption) (context.Context, oteltrace.Span)
NewSpanFromSpanContext is like NewSpan but uses a custom span context to work
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.