Skip to content

Commit

Permalink
.count metric naming convention only applies to UpDownCounters (ope…
Browse files Browse the repository at this point in the history
  • Loading branch information
trask authored and rapphil committed Aug 14, 2023
1 parent be82642 commit fe818fd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ release.

- Fix the unit of metric.process.runtime.jvm.system.cpu.load_1m to be {run_queue_item}
([#95](https://github.com/open-telemetry/semantic-conventions/pull/95))
- Update `.count` metric naming convention so that it only applies to UpDownCounters,
and add that `.total` should not be used by either Counters or UpDownCounters
([#107](https://github.com/open-telemetry/opentelemetry-specification/pull/107))

## v1.21.0 (2023-07-13)

Expand Down
20 changes: 16 additions & 4 deletions docs/general/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ aliases: [docs/specs/semconv/general/metrics-general]
- [General Guidelines](#general-guidelines)
* [Name Reuse Prohibition](#name-reuse-prohibition)
* [Units](#units)
* [Pluralization](#pluralization)
+ [Use `count` Instead of Pluralization](#use-count-instead-of-pluralization)
* [Naming rules for Counters and UpDownCounters](#naming-rules-for-counters-and-updowncounters)
+ [Pluralization](#pluralization)
+ [Use `count` Instead of Pluralization for UpDownCounters](#use-count-instead-of-pluralization-for-updowncounters)
+ [Do not use `total`](#do-not-use-total)
- [General Metric Semantic Conventions](#general-metric-semantic-conventions)
* [Instrument Naming](#instrument-naming)
* [Instrument Units](#instrument-units)
Expand Down Expand Up @@ -99,7 +101,9 @@ When building components that interoperate between OpenTelemetry and a system
using the OpenMetrics exposition format, use the
[OpenMetrics Guidelines](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.22.0/specification/compatibility/prometheus_and_openmetrics.md).

### Pluralization
### Naming rules for Counters and UpDownCounters

#### Pluralization

Metric names SHOULD NOT be pluralized, unless the value being recorded
represents discrete instances of a
Expand All @@ -114,7 +118,7 @@ should not be pluralized, even if many data points are recorded.
* `system.paging.faults`, `system.disk.operations`, and `system.network.packets`
should be pluralized, even if only a single data point is recorded.

#### Use `count` Instead of Pluralization
#### Use `count` Instead of Pluralization for UpDownCounters

If the value being recorded represents the count of concepts signified
by the namespace then the metric should be named `count` (within its namespace).
Expand All @@ -125,6 +129,14 @@ to the processes then to represent the count of the processes we can have a metr
`system.processes.count`. The suffix `count` here indicates that it is the count of
`system.processes`.

#### Do not use `total`

UpDownCounters SHOULD NOT use `_total` because then they will look like
monotonic sums.

Counters SHOULD NOT append `_total` either because then their meaning will
be confusing in delta backends.

## General Metric Semantic Conventions

**Status**: [Mixed][DocumentStatus]
Expand Down

0 comments on commit fe818fd

Please sign in to comment.