Skip to content

Commit

Permalink
[hotrod] Delay env var mapping until logger is initialized
Browse files Browse the repository at this point in the history
Signed-off-by: Yuri Shkuro <[email protected]>
  • Loading branch information
yurishkuro committed Jul 17, 2024
1 parent d3c7d67 commit fffb275
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/hotrod/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ func init() {

// onInitialize is called before the command is executed.
func onInitialize() {
jaegerclientenv2otel.MapJaegerToOtelEnvVars(logger)

zapOptions := []zap.Option{
zap.AddStacktrace(zapcore.FatalLevel),
zap.AddCallerSkip(1),
Expand All @@ -68,6 +66,9 @@ func onInitialize() {
)
}
logger, _ = zap.NewDevelopment(zapOptions...)

jaegerclientenv2otel.MapJaegerToOtelEnvVars(logger)

metricsFactory = prometheus.New().Namespace(metrics.NSOptions{Name: "hotrod", Tags: nil})

if config.MySQLGetDelay != fixDBConnDelay {
Expand Down

0 comments on commit fffb275

Please sign in to comment.