From 52beb1097f7525d97d2d5b6bc84da1a0176ec3fc Mon Sep 17 00:00:00 2001 From: Davin Date: Sat, 2 Sep 2023 13:19:06 -0500 Subject: [PATCH] fix: Updating metric registrations in the start function of the EMAThroughputSampler (#845) Updating the name of the metrics being registered during the Start function in the EMAThroughputSampler ## Which problem is this PR solving? - #844 ## Short description of the changes Change Register calls from this: ```go d.Metrics.Register("dynsampler_num_dropped", "counter") d.Metrics.Register("dynsampler_num_kept", "counter") d.Metrics.Register("dynsampler_sample_rate", "histogram") ``` to this: ```go d.Metrics.Register(d.prefix+"num_dropped", "counter") d.Metrics.Register(d.prefix+"num_kept", "counter") d.Metrics.Register(d.prefix+"sample_rate", "histogram") ``` Signed-off-by: Davin Taddeo Co-authored-by: Kent Quirk --- sample/ema_throughput.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sample/ema_throughput.go b/sample/ema_throughput.go index 8fb15c2782..1ef22745e6 100644 --- a/sample/ema_throughput.go +++ b/sample/ema_throughput.go @@ -74,9 +74,9 @@ func (d *EMAThroughputSampler) Start() error { for name := range d.lastMetrics { d.Metrics.Register(name, getMetricType(name)) } - d.Metrics.Register("dynsampler_num_dropped", "counter") - d.Metrics.Register("dynsampler_num_kept", "counter") - d.Metrics.Register("dynsampler_sample_rate", "histogram") + d.Metrics.Register(d.prefix+"num_dropped", "counter") + d.Metrics.Register(d.prefix+"num_kept", "counter") + d.Metrics.Register(d.prefix+"sample_rate", "histogram") return nil }