Skip to content

Commit

Permalink
Remove in memory sink from fanout and add latency sampling methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jayy04 authored and lcwik committed Dec 6, 2023
1 parent 02d061c commit acaae16
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions telemetry/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func New(cfg Config) (_ *Metrics, rerr error) {
}()

m := &Metrics{memSink: memSink}
fanout := metrics.FanoutSink{memSink}
var sink metrics.MetricSink

if cfg.PrometheusRetentionTime > 0 {
m.prometheusEnabled = true
Expand All @@ -111,10 +111,12 @@ func New(cfg Config) (_ *Metrics, rerr error) {
return nil, err
}

fanout = append(fanout, promSink)
sink = promSink
} else {
sink = memSink
}

if _, err := metrics.NewGlobal(metricsConf, fanout); err != nil {
if _, err := metrics.NewGlobal(metricsConf, sink); err != nil {
return nil, err
}

Expand Down

0 comments on commit acaae16

Please sign in to comment.