Skip to content

Commit

Permalink
Add error handling when config.FromEnv fails
Browse files Browse the repository at this point in the history
  • Loading branch information
eundoosong committed Oct 12, 2018
1 parent 04a4652 commit 07a2cb0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/hotrod/pkg/tracing/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ import (
// Init creates a new instance of Jaeger tracer.
func Init(serviceName string, metricsFactory metrics.Factory, logger log.Factory) opentracing.Tracer {
cfg, err := config.FromEnv()
if err != nil {
logger.Bg().Fatal("cannot parse Jaeger env vars", zap.Error(err))
}
cfg.ServiceName = serviceName
cfg.Sampler.Type = "const"
cfg.Sampler.Param = 1
Expand Down

0 comments on commit 07a2cb0

Please sign in to comment.