diff --git a/telemetry/metrics.go b/telemetry/metrics.go index f551250a308..aa39ff146b9 100644 --- a/telemetry/metrics.go +++ b/telemetry/metrics.go @@ -113,10 +113,15 @@ func New(cfg Config) (_ *Metrics, rerr error) { memSink := metrics.NewInmemSink(10*time.Second, time.Minute) sink = memSink inMemSig := metrics.DefaultInmemSignal(memSink) - defer func() { - if rerr != nil { - inMemSig.Stop() - } + case "mem": + memSink := metrics.NewInmemSink(10*time.Second, time.Minute) + sink = memSink + inMemSig := metrics.DefaultInmemSignal(memSink) + defer func() { + if rerr != nil { + inMemSig.Stop() + } + }() }() case "statsd": var err error