forked from Ivasoft/traefik
Override jaeger configuration with env variables
This commit is contained in:
@@ -68,7 +68,7 @@ func (c *Config) Setup(componentName string) (opentracing.Tracer, io.Closer, err
|
||||
reporter.Password = c.Collector.Password
|
||||
}
|
||||
|
||||
jcfg := jaegercfg.Configuration{
|
||||
jcfg := &jaegercfg.Configuration{
|
||||
Sampler: &jaegercfg.SamplerConfig{
|
||||
SamplingServerURL: c.SamplingServerURL,
|
||||
Type: c.SamplingType,
|
||||
@@ -80,6 +80,12 @@ func (c *Config) Setup(componentName string) (opentracing.Tracer, io.Closer, err
|
||||
},
|
||||
}
|
||||
|
||||
// Overrides existing tracer's Configuration with environment variables.
|
||||
_, err := jcfg.FromEnv()
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
jMetricsFactory := jaegermet.NullFactory
|
||||
|
||||
opts := []jaegercfg.Option{
|
||||
@@ -106,7 +112,7 @@ func (c *Config) Setup(componentName string) (opentracing.Tracer, io.Closer, err
|
||||
opts...,
|
||||
)
|
||||
if err != nil {
|
||||
log.WithoutContext().Warnf("Could not initialize jaeger tracer: %s", err.Error())
|
||||
log.WithoutContext().Warnf("Could not initialize jaeger tracer: %v", err)
|
||||
return nil, nil, err
|
||||
}
|
||||
log.WithoutContext().Debug("Jaeger tracer configured")
|
||||
|
||||
Reference in New Issue
Block a user