-
Notifications
You must be signed in to change notification settings - Fork 773
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] Fix OpenMetrics format suffixes #5646
[prometheus] Fix OpenMetrics format suffixes #5646
Conversation
src/OpenTelemetry.Exporter.Prometheus.HttpListener/Internal/PrometheusMetric.cs
Show resolved
Hide resolved
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5646 +/- ##
===========================================
- Coverage 83.38% 20.12% -63.27%
===========================================
Files 297 185 -112
Lines 12531 7917 -4614
===========================================
- Hits 10449 1593 -8856
- Misses 2082 6324 +4242
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@robertcoltheart Thanks a lot for taking good care of Prometheus exporters! |
src/OpenTelemetry.Exporter.Prometheus.HttpListener/Internal/PrometheusMetric.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.Prometheus.HttpListener/Internal/PrometheusMetric.cs
Outdated
Show resolved
Hide resolved
@robertcoltheart I'm happy to merge this because there are approvals but there is also some open feedback from @dashpole. Are you going to respond or make more changes or should I merge? |
Let me make the suggested changes, and then we can review again |
Fixes #5502
Changes
According to the OpenMetrics specs,
unit
must be a suffix of the metric name, and not just infix in the name. This PR also complies with the requirement that counters MUST end with_total
, although this clashes with the OTEL spec that says it should be optional. Additionally, UNIT, HELP and TYPE metadata should not include the_total
suffix, as seen in examples in the OpenMetrics specs.Tested with the latest version of Prometheus.
See:
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes