A Golang library for exporting performance and runtime metrics to external metrics systems (i.e. statsite, statsd)
1.46k
stars
177
forks
source link
FanoutSink key modified across sinks when DogStatsdSink is enabled #154
Closed
Achooo closed 1 year ago
Problem
https://github.com/hashicorp/go-metrics/blob/858601465fcd6976fa4b951419becea272d25579/datadog/dogstatsd.go#L63-L77
Reproduction Steps
SetGaugeWithLabels()
with the hostname as a value in the keysExample of a test I added in
datadog/dogstatsd_test.go
:Output
Expected Output
I would expect the key in the inmemsink to remain
consul.metric
but it is modified tometric.metric
Fix
The FanoutSink should ideally copy the key before passing it to sinks to avoid modifications