WithTracerProvider returns an option that stores the given trace provider in the component's context.
(tp trace.TracerProvider)
| 142 | // WithTracerProvider returns an option that stores the given trace provider |
| 143 | // in the component's context. |
| 144 | func 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. |
| 154 | func New(logger log.Stack, config *Config, opts ...Option) (c *Component, err error) { |
no test coverage detected