Skip to content

Commit

Permalink
fix: Updating metric registrations in the start function of the EMATh…
Browse files Browse the repository at this point in the history
…roughputSampler (#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 <[email protected]>
Co-authored-by: Kent Quirk <[email protected]>
  • Loading branch information
tdarwin and kentquirk authored Sep 2, 2023
1 parent 022b8a1 commit 52beb10
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sample/ema_throughput.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 52beb10

Please sign in to comment.