From 73d493416e146427cf3f7eb1a858a8324b9e3408 Mon Sep 17 00:00:00 2001 From: jeremy Date: Thu, 9 Jun 2022 02:57:21 +0000 Subject: [PATCH] check for nil config and return noop --- common/metrics/events.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/metrics/events.go b/common/metrics/events.go index b9c37e525bd..413aa50d4db 100644 --- a/common/metrics/events.go +++ b/common/metrics/events.go @@ -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 {