Skip to content

Commit

Permalink
Prometheus compatibility: don't add duplicate _total suffixes (#3581)
Browse files Browse the repository at this point in the history
Clarifies that _total does not need to be added as a suffix to counters
if it already exists. There was confusion in
open-telemetry/opentelemetry-java#5304 (comment)
if that was correct or not.
  • Loading branch information
dashpole authored Jul 6, 2023
1 parent 0e31384 commit 31e9882
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ release.

### Compatibility

- Prometheus: Do not add `_total` suffix if the metric already ends in `_total`.
([#3581](https://github.com/open-telemetry/opentelemetry-specification/pull/3581))

### OpenTelemetry Protocol

### SDK Configuration
Expand Down
2 changes: 1 addition & 1 deletion specification/compatibility/prometheus_and_openmetrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ An [OpenTelemetry Gauge](../metrics/data-model.md#gauge) MUST be converted to a
- The new data point's start time must match the time of the accumulated data point. If not, see [detecting alignment issues](../metrics/data-model.md#sums-detecting-alignment-issues).
- Otherwise, it MUST be dropped.

Monotonic Sum metric points MUST have `_total` added as a suffix to the metric name.
If the metric name for monotonic Sum metric points does not end in a suffix of `_total` a suffix of `_total` MUST be added, otherwise the name MUST remain unchanged.
Monotonic Sum metric points with `StartTimeUnixNano` should export the `{name}_created` metric as well.

### Histograms
Expand Down

0 comments on commit 31e9882

Please sign in to comment.