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

Clarify metric attributes should be namespaced #786

Merged
Merged
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
5 changes: 5 additions & 0 deletions .chloggen/clarify-metric-namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
change_type: 'enhancement'
component: metrics
note: Clarify metric attributes should be namespaced.
issues: [394]
subtext:
21 changes: 21 additions & 0 deletions docs/general/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ aliases: [docs/specs/semconv/general/metrics-general]

- [General Guidelines](#general-guidelines)
- [Name Reuse Prohibition](#name-reuse-prohibition)
- [Metric attributes](#metric-attributes)
- [Units](#units)
- [Naming rules for Counters and UpDownCounters](#naming-rules-for-counters-and-updowncounters)
- [Pluralization](#pluralization)
Expand Down Expand Up @@ -89,6 +90,26 @@ When introducing a new metric name check all existing schema files to make sure
the name does not appear as a key of any "rename_metrics" section (keys denote
old metric names in rename operations).

### Metric attributes

Metric attributes SHOULD follow the general [attribute naming rules](attribute-naming.md).
In particular, metric attributes SHOULD have a namespace.

Metric attributes SHOULD be added under the metric namespace when their usage and
semantics are exclusive to the metric.

Examples:

Attributes `mode` and `mountpoint` for metric `system.filesystem.usage`
should be namespaced as `system.filesystem.mode` and `system.filesystem.mountpoint`.

Metrics can also have attributes outside of their namespace.

Examples:

Metric `http.server.request.duration` uses attributes from the registry such as
`server.port`, `error.type`.

### Units

Conventional metrics or metrics that have their units included in
Expand Down
Loading