Skip to content

Commit a5509c6

Browse files
authored
.count metric naming convention only applies to UpDownCounters (#107)
1 parent fbf46a1 commit a5509c6

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ release.
99

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

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

docs/general/metrics.md

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

102-
### Pluralization
104+
### Naming rules for Counters and UpDownCounters
105+
106+
#### Pluralization
103107

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

117-
#### Use `count` Instead of Pluralization
121+
#### Use `count` Instead of Pluralization for UpDownCounters
118122

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

132+
#### Do not use `total`
133+
134+
UpDownCounters SHOULD NOT use `_total` because then they will look like
135+
monotonic sums.
136+
137+
Counters SHOULD NOT append `_total` either because then their meaning will
138+
be confusing in delta backends.
139+
128140
## General Metric Semantic Conventions
129141

130142
**Status**: [Mixed][DocumentStatus]

0 commit comments

Comments
 (0)