MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / FromContext

Function FromContext

pkg/telemetry/tracing/context.go:34–40  ·  view source on GitHub ↗

FromContext returns the tracer provider that is attached to the context or returns a noop tracer provider if it does not exist.

(ctx context.Context)

Source from the content-addressed store, hash-verified

32// FromContext returns the tracer provider that is attached to the context
33// or returns a noop tracer provider if it does not exist.
34func FromContext(ctx context.Context) otrace.TracerProvider {
35 v := ctx.Value(tracerProviderKey)
36 if v == nil {
37 return otrace.NewNoopTracerProvider()
38 }
39 return v.(otrace.TracerProvider)
40}

Callers 7

NewFunction · 0.92
NewContextWithTracerFunction · 0.92
FromContextFunction · 0.92
NewFunction · 0.92
DefaultDialOptionsFunction · 0.92
NewFunction · 0.92
HTTPClientMethod · 0.92

Calls 1

ValueMethod · 0.45

Tested by

no test coverage detected