Skip to content

Commit

Permalink
moving handler instantiation to allow noop reporter for autosetup (#2960
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jbreiding committed Jun 7, 2022
1 parent b4f2ff5 commit 81e7a13
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions temporal/fx.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,14 @@ func ServerOptionsProvider(opts []ServerOption) (serverOptionsProvider, error) {
clientFactoryProvider = client.NewFactoryProvider()
}

handler := metrics.MetricHandlerFromConfig(logger, so.config.Global.Metrics)

// ServerReporter
serverReporter := so.metricsReporter
if serverReporter == nil {
if so.config.Global.Metrics == nil {
logger.Warn("no metrics config provided, using noop reporter")
serverReporter = metrics.NoopReporter
} else {
handler := metrics.MetricHandlerFromConfig(logger, so.config.Global.Metrics)
serverReporter = metrics.NewEventsReporter(handler)
}
}
Expand Down

0 comments on commit 81e7a13

Please sign in to comment.