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

Function WithTracerProvider

pkg/component/component.go:144–151  ·  view source on GitHub ↗

WithTracerProvider returns an option that stores the given trace provider in the component's context.

(tp trace.TracerProvider)

Source from the content-addressed store, hash-verified

142// WithTracerProvider returns an option that stores the given trace provider
143// in the component's context.
144func WithTracerProvider(tp trace.TracerProvider) Option {
145 return func(c *Component) {
146 c.ctx = tracing.NewContextWithTracerProvider(c.ctx, tp)
147 c.AddContextFiller(func(ctx context.Context) context.Context {
148 return tracing.NewContextWithTracerProvider(ctx, tp)
149 })
150 }
151}
152
153// New returns a new component.
154func New(logger log.Stack, config *Config, opts ...Option) (c *Component, err error) {

Callers 1

start.goFile · 0.92

Calls 2

AddContextFillerMethod · 0.80

Tested by

no test coverage detected