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

Metric names and namespaces should not be pluralized #3658

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ release.
([#3242](https://github.com/open-telemetry/opentelemetry-specification/pull/3242))
- Promote MetricProducer specification to feature-freeze.
([#3600](https://github.com/open-telemetry/opentelemetry-specification/pull/3600))
- Metric names and namespaces should not be pluralized.
([#3658](https://github.com/open-telemetry/opentelemetry-specification/pull/3658))

### Logs

Expand Down
29 changes: 5 additions & 24 deletions specification/metrics/semantic_conventions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ No changes to this document are allowed.
* [Name Reuse Prohibition](#name-reuse-prohibition)
* [Units](#units)
* [Pluralization](#pluralization)
+ [Use `count` Instead of Pluralization](#use-count-instead-of-pluralization)
- [General Metric Semantic Conventions](#general-metric-semantic-conventions)
* [Instrument Naming](#instrument-naming)
* [Instrument Units](#instrument-units)
Expand Down Expand Up @@ -106,29 +105,7 @@ using the OpenMetrics exposition format, use the

### Pluralization

Metric names SHOULD NOT be pluralized, unless the value being recorded
represents discrete instances of a
[countable quantity](https://en.wikipedia.org/wiki/Count_noun).
Generally, the name SHOULD be pluralized only if the unit of the metric in
question is a non-unit (like `{fault}` or `{operation}`).

Examples:

* `system.filesystem.utilization`, `http.server.duration`, and `system.cpu.time`
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

If the value being recorded represents the count of concepts signified
by the namespace then the metric should be named `count` (within its namespace).
The pluralization rule does not apply in this case.

For example if we have a namespace `system.processes` which contains all metrics related
to the processes then to represent the count of the processes we can have a metric named
`system.processes.count`. The suffix `count` here indicates that it is the count of
`system.processes`.
Metric names and namespaces SHOULD NOT be pluralized.

## General Metric Semantic Conventions

Expand All @@ -142,6 +119,10 @@ followed for other instruments not explicitly defined in this document.

**Status**: [Experimental](../../document-status.md)

- **count** - an instrument that measures the count of concepts signified
by the namespace should be called `entity.count`. For example,
`system.process.count`.

- **limit** - an instrument that measures the constant, known total amount of
something should be called `entity.limit`. For example, `system.memory.limit`
for the total amount of memory on a system.
Expand Down
Loading