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

Prometheus exporter: Add unit to metric names, and convert unit to words #1840

Closed
dashpole opened this issue Dec 5, 2022 · 1 comment · Fixed by #2213
Closed

Prometheus exporter: Add unit to metric names, and convert unit to words #1840

dashpole opened this issue Dec 5, 2022 · 1 comment · Fixed by #2213
Assignees
Labels
area:exporter:prometheus Prometheus Exporter area:metrics OpenTelemetry metrics do-not-stale

Comments

@dashpole
Copy link
Contributor

dashpole commented Dec 5, 2022

Describe the solution you'd like

From the OTel prometheus compatibility spec:

The Unit of an OTLP metric point MUST be added as OpenMetrics UNIT metadata. Additionally, the unit MUST be added as a suffix to the metric name, and SHOULD be converted to base units recommended by OpenMetrics when possible. The unit suffix comes before any type-specific suffixes.

For now, I would hold off trying to convert to base units (e.g. milliseconds to seconds), but would still encourage converting from abbreviations to full words for the unit (e.g. ms to milliseconds).

For example, a metric with name "foo", type=monotonic sum, unit=ms should have the name: foo_milliseconds_total.

The current behavior is that the name of the metric would be foo_total.

@github-actions
Copy link

github-actions bot commented Feb 4, 2023

This issue was marked as stale due to lack of activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:exporter:prometheus Prometheus Exporter area:metrics OpenTelemetry metrics do-not-stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants