-
Notifications
You must be signed in to change notification settings - Fork 440
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
Prometheus exporter adds underscore suffix for metrics without unit #2317
Comments
This was seen on gRPC C++'s OTel plugin, but the pattern of usage is nothing out of the ordinary from what I understand. Reference - https://github.com/grpc/grpc/blob/62521a889fe134859aed7bdf4ea0730534f15d09/src/cpp/ext/otel/otel_plugin.cc#L170 A Meter with the name "grpc" was created, and a counter instrument with the name "grpc.client.attempt.started" was created out of it. The counter was incremented like so - https://github.com/grpc/grpc/blob/62521a889fe134859aed7bdf4ea0730534f15d09/src/cpp/ext/otel/otel_client_filter.cc#L122 |
This issue was marked as stale due to lack of activity. |
Steps to reproduce
If a metric does not have a unit set, the prometheus exporter will add an extra
_
suffix to the metric. I have only second-hand knowledge of the issue, and don't have reproduction steps.What is the expected behavior?
If the unit is empty, the name should not have an underscore or unit suffix added.
What is the actual behavior?
The metric
grpc.client.attempt.started
without a unit turns into:I believe this is because of this line:
opentelemetry-cpp/exporters/prometheus/src/exporter_utils.cc
Line 45 in 0563a71
We append an underscore regardless of if the unit is empty or not.
The text was updated successfully, but these errors were encountered: