-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Metric Name with multiple consecutive underscores has its underscores reduced to one thus resulting in change of name of the metric. #35244
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Similar to open-telemetry/opentelemetry-go#5755, we should switch the prometheus exporter to use |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
cc @ywwg I think you were going to work on switching to model.EscapeName |
yes, though as I looked in to it, the otel normalization algorithm does this underscore removal as part of its larger normalization process and it is not trivial to fix. I am thinking about a more general rewrite / refactor of the normalization code that could fix this, so I can take this as an assignment (which I don't have the permissions for) |
Component(s)
exporter/prometheus
What happened?
Description
Using Open Telemetry Java sdk, when i create a metric with name of format
myprefix___l1_l2_actualName
, then otel collector displays the metric on its Prometheus exporter asmyprefix_l1_l2_actualName
. (Underscores are reduced)myprefix___l1_l2_actualName
is a valid metric name according to Prometheus Data Model.myprefix___l1_l2_actualName
does match the provided regex[a-zA-Z_:][a-zA-Z0-9_:]*
according to prometheus data model. This can be verified with Regex 101 with PCRE PHP <7.3. Also this metric doesn't start with "__" (double underscores) which are reserved for internal use as per Prometheus' Metric names and labels guidelines. Hence it is a valid metric name.If I use File exporter instead of Prometheus exporter then the expected name of the metric is observed in the file.
See the Otel configuration provided in the issue.
Steps to Reproduce Using Otel Java SDK.
Expected Result
Metric with name
myprefix___l1_l2_actualName
should be available on collector's 8089/Metrics endpoint. (Maintain all the given underscores).Actual Result
Metric with name
myprefix_l1_l2_actualName
is be available on collector's 8089/Metrics endpoint.Collector version
v0.104.0
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")
I was using docker image "otel/opentelemetry-collector-contrib:0.104.0-amd64"
OpenTelemetry Collector configuration
Log output
Additional context
This affects backward compatibility in as the name of the metric that appears on collector's prometheus exporter (/metrics) is different from the one that was originally in use. All the existing Grafana dashboards and Prometheus alerts will be affected as the metric name is has less underscores.
The text was updated successfully, but these errors were encountered: