Skip to content

Commit

Permalink
[chore] Move metric requirement levels doc from spec (#831)
Browse files Browse the repository at this point in the history
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
  • Loading branch information
joaopgrassi and trask authored Mar 22, 2024
1 parent 80a2d1a commit f94edec
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 13 deletions.
4 changes: 2 additions & 2 deletions docs/database/database-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,5 +191,5 @@ This metric is [recommended][MetricRecommended].
<!-- endsemconv -->

[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md
[MetricRequired]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/metrics/metric-requirement-level.md#required
[MetricRecommended]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/metrics/metric-requirement-level.md#recommended
[MetricRequired]: /docs/general/metric-requirement-level.md#required
[MetricRecommended]: /docs/general/metric-requirement-level.md#recommended
2 changes: 1 addition & 1 deletion docs/faas/faas-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,4 +301,4 @@ FaaS providers. This list is not exhaustive.
* [OpenFaas Metrics](https://docs.openfaas.com/architecture/metrics/)

[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md
[MetricRecommended]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/metrics/metric-requirement-level.md#recommended
[MetricRecommended]: /docs/general/metric-requirement-level.md#recommended
43 changes: 43 additions & 0 deletions docs/general/metric-requirement-level.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Metric Requirement Levels

**Status**: [Stable][DocumentStatus]

<details>
<summary>Table of Contents</summary>

<!-- toc -->

- [Required](#required)
- [Recommended](#recommended)
- [Opt-In](#opt-in)

<!-- tocstop -->

</details>

The following metric requirement levels are specified:

- [Required](#required)
- [Recommended](#recommended)
- [Opt-In](#opt-in)

## Required

All instrumentations MUST emit the metric.
A semantic convention defining a Required metric expects that an absolute majority of instrumentation libraries and applications are able to efficiently emit it.

## Recommended

Instrumentations SHOULD emit the metric by default if it's readily available and can be efficiently emitted. Instrumentations MAY offer a configuration option to disable Recommended metrics.

Instrumentations that decide not to emit `Recommended` metrics due to performance, security, privacy, or other consideration by default, SHOULD allow for opting in to emitting them as defined for the `Opt-In` requirement level if the metrics are logically applicable.

## Opt-In

Instrumentations SHOULD emit the metric if and only if the user configures the instrumentation to do so.
Instrumentation that doesn't support configuration MUST NOT emit `Opt-In` metrics.

This attribute requirement level is recommended for metrics that are particularly expensive to retrieve or might pose a security or privacy risk. These should therefore only be enabled deliberately by a user making an informed decision.

[DocumentStatus]:
https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md
6 changes: 3 additions & 3 deletions docs/messaging/messaging-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,6 @@ _Note: The need to report `messaging.process.messages` depends on the messaging
<!-- endsemconv -->

[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.21.0/specification/document-status.md
[MetricRequired]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.21.0/specification/metrics/metric-requirement-level.md#required
[MetricRecommended]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.21.0/specification/metrics/metric-requirement-level.md#recommended
[MetricOptIn]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.21.0/specification/metrics/metric-requirement-level.md#opt-in
[MetricRequired]: /docs/general/metric-requirement-level.md#required
[MetricRecommended]: /docs/general/metric-requirement-level.md#recommended
[MetricOptIn]: /docs/general/metric-requirement-level.md#opt-in
2 changes: 1 addition & 1 deletion docs/rpc/rpc-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,4 +289,4 @@ More specific Semantic Conventions are defined for the following RPC technologie
* [JSON-RPC](json-rpc.md): Semantic Conventions for *JSON-RPC*.

[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md
[MetricRecommended]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/metrics/metric-requirement-level.md#recommended
[MetricRecommended]: /docs/general/metric-requirement-level.md#recommended
4 changes: 2 additions & 2 deletions docs/runtime/jvm-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,5 +455,5 @@ This metric is obtained from [`BufferPoolMXBean#getCount()`](https://docs.oracle
<!-- endsemconv -->

[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md
[MetricOptIn]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/metrics/metric-requirement-level.md#opt-in
[MetricRecommended]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/metrics/metric-requirement-level.md#recommended
[MetricOptIn]: /docs/general/metric-requirement-level.md#opt-in
[MetricRecommended]: /docs/general/metric-requirement-level.md#recommended
2 changes: 1 addition & 1 deletion docs/system/process-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,4 +238,4 @@ This metric is [recommended][MetricRecommended].
<!-- endsemconv -->

[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md
[MetricRecommended]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/metrics/metric-requirement-level.md#recommended
[MetricRecommended]: /docs/general/metric-requirement-level.md#recommended
4 changes: 2 additions & 2 deletions docs/system/system-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -795,8 +795,8 @@ An instrument for load average over 1 minute on Linux could be named
an `{os}` prefix to split this metric across OSes.

[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/document-status.md
[MetricRecommended]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/metrics/metric-requirement-level.md#recommended
[MetricOptIn]: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.26.0/specification/metrics/metric-requirement-level.md#opt-in
[MetricRecommended]: /docs/general/metric-requirement-level.md#recommended
[MetricOptIn]: /docs/general/metric-requirement-level.md#opt-in

### Metric: `system.linux.memory.available`

Expand Down
2 changes: 1 addition & 1 deletion model/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ the generated markdown output in the [docs](../docs/README.md) folder.
Semantic conventions for the spec MUST adhere to the
[attribute naming](../docs/general/attribute-naming.md),
[attribute requirement level](../docs/general/attribute-requirement-level.md),
and [metric requirement level](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/metrics/metric-requirement-level.md) conventions.
and [metric requirement level](../docs/general/metric-requirement-level.md) conventions.

Refer to the [syntax](https://github.com/open-telemetry/build-tools/tree/v0.23.0/semantic-conventions/syntax.md)
for how to write the YAML files for semantic conventions and what the YAML properties mean.
Expand Down

0 comments on commit f94edec

Please sign in to comment.