tracer

package
v2.0.5-testnet Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2024 License: Apache-2.0, MIT Imports: 14 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL