Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve clarity on non-acceptable metric name formats #211

Open
solodynamo-dhero opened this issue Jul 28, 2021 · 1 comment
Open

Improve clarity on non-acceptable metric name formats #211

solodynamo-dhero opened this issue Jul 28, 2021 · 1 comment

Comments

@solodynamo-dhero
Copy link

datadog-agent image version: datadog/cluster-agent:1.9.0
datadog-go version: v4.4.0

Issue:
metric name: "db.cache.status:hit"
usage: s.datadogClient.Count("db.cache.status:hit", 1, nil, 1)
Above will fail on runtime with error:
2021-07-28 09:22:25 UTC | CORE | ERROR | (pkg/dogstatsd/server.go:422 in errLog) | Dogstatsd: error parsing metric message '"db.cache.status:hit:1|c|#env:production,service:some-service version:production--27a9a01"': could not parse dogstatsd metric value: strconv.ParseFloat: parsing "hit:1": invalid syntax

Reason:
forwarder logic calls this function
It separates the name from a value using ":" as a separator.

In my case, it will set the value = hit:1 which is wrong and while parsing to float64 it will fail.

Possible Solution:
We should have validation check on metric functions to reject such names or at least document them so other devs don't face such an issue.

Let me know if any other info is needed ✌️

@solodynamo-dhero
Copy link
Author

Also, I came across this doc: https://docs.datadoghq.com/metrics/custom_metrics/#naming-custom-metrics

: is a non-alphanumeric character.

It does state that we should use only ASCII alphanumeric character

By document, we can have Godoc like ones so IntelliSense can expose such details.

@solodynamo-dhero solodynamo-dhero changed the title Provide clarity on non-acceptable metric name formats Improve clarity on non-acceptable metric name formats Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant