syntaqx / go-metrics-datadog

DataDog client reporter for go-metrics
https://pkg.go.dev/github.com/syntaqx/go-metrics-datadog
MIT License
6 stars 7 forks source link

Bug in reportCount func while flushing counter metrics #5

Open srikar-jilugu opened 1 month ago

srikar-jilugu commented 1 month ago

here using name as the key for storing previous values of the metric, leading to corrupted value for metrics of the same name but having different tags. https://github.com/syntaqx/go-metrics-datadog/blob/2095153ab96a32347decfcabb9cd240432dbb0aa/reporter.go#L91

Expected Behaviour value of metric with {name,tags} pair should be independent of each other.

Current Behaviour last updated value of one metric with the same name is effecting the updated count value of others. https://github.com/syntaqx/go-metrics-datadog/blob/2095153ab96a32347decfcabb9cd240432dbb0aa/reporter.go#L89

syntaqx commented 5 days ago

Sorry for the late response, this project has been mostly in an ice box for me. You're welcome to send a pull request for the patch!

srikar-jilugu commented 8 hours ago

hey thanks for responding, raised a PR for the fix.