Skip to content

Commit

Permalink
check for nil config and return noop (#2979)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbreiding committed Jun 9, 2022
1 parent 8114a4f commit 5135a68
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions common/metrics/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ var _ MetricProvider = (*eventsMetricProvider)(nil)

// MetricHandlerFromConfig is used at startup to construct
func MetricHandlerFromConfig(logger log.Logger, c *Config) MetricHandler {
if c == nil {
return NoopMetricHandler
}

setDefaultPerUnitHistogramBoundaries(&c.ClientConfig)
if c.Prometheus != nil && len(c.Prometheus.Framework) > 0 {
switch c.Prometheus.Framework {
Expand Down

0 comments on commit 5135a68

Please sign in to comment.