Documentation ¶
Index ¶
- Variables
- func AddEvent(ctx context.Context, event string, kvs map[string]interface{})
- func AutoTrace(operation string, options ...otelhttp.Option) func(handler http.Handler) http.Handler
- func BagMemberValue(ctx context.Context, key string) string
- func ContextWithBaggage(ctx context.Context, kvs ...string) context.Context
- func SpanID(ctx context.Context) string
- func TraceID(ctx context.Context) string
- type Closer
- type TracerProviderOptionFunc
Constants ¶
This section is empty.
Variables ¶
var DefaultHTTPClient = otelhttp.DefaultClient
DefaultHTTPClient is otelhttp.DefaultClient
var Options = options{}
Options is the entry point of creating options to configure the trace provider.
Functions ¶
func AddEvent ¶
AddEvent adds the given event, with key value parameters to the current span. The permitted types for the parameters are string, int, int64, float64, bool, []string and []interface{}, otherwise the method panics.
func AutoTrace ¶
func AutoTrace(operation string, options ...otelhttp.Option) func(handler http.Handler) http.Handler
AutoTrace returns a new HTTP middleware that automatically starts a trace, or inherits an existing trace.
func BagMemberValue ¶
BagMemberValue retrieves the value of the baggage member carried by the current span.
func ContextWithBaggage ¶
ContextWithBaggage returns a new context.Context with key value pairs set as baggage.
Types ¶
type Closer ¶
type Closer func() error
Closer should be invoked to properly shut down the trace provider.
func Init ¶
func Init(ctx context.Context, options ...TracerProviderOptionFunc) (*sdktrace.TracerProvider, Closer, error)
Init returns a new trace provider initialized according to the given options and sets it as the global provider. It also returns a shutdown hook to be invoked to properly shut down the trace provider.
type TracerProviderOptionFunc ¶
type TracerProviderOptionFunc func() (sdktrace.TracerProviderOption, error)
TracerProviderOptionFunc can return an tracer provider option, and potentially an error.