Skip to content
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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ release.

### Metrics

- Prometheus receiver can expect `otel_scope_schema_url` and `otel_scope_[attribute]` labels on all metrics.
([#4505](https://github.com/open-telemetry/opentelemetry-specification/pull/4505))
- Prometheus receiver no longer expects `otel_scope_info` metric.
([#4505](https://github.com/open-telemetry/opentelemetry-specification/pull/4505))
- Prometheus exporter adds `otel_scope_schema_url` and `otel_scope_[attribute]` labels on all metrics.
([#4505](https://github.com/open-telemetry/opentelemetry-specification/pull/4505))
- Prometheus exporter no longer exports `otel_scope_info` metric.
([#4505](https://github.com/open-telemetry/opentelemetry-specification/pull/4505))

### Logs

### Baggage
Expand Down
4 changes: 2 additions & 2 deletions spec-compliance-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ Disclaimer: Declarative configuration is currently in Development status - work
| [HELP Metadata](specification/compatibility/prometheus_and_openmetrics.md#metric-metadata-1) | | + | + | + | + | - | - | - | + | + | + | + |
| [TYPE Metadata](specification/compatibility/prometheus_and_openmetrics.md#metric-metadata-1) | | + | + | + | + | - | - | - | + | + | + | + |
| [otel_scope_name and otel_scope_version labels on all Metrics](specification/compatibility/prometheus_and_openmetrics.md#instrumentation-scope-1) | | + | + | - | - | - | - | - | + | - | - | - |
| [otel_scope_info metric](specification/compatibility/prometheus_and_openmetrics.md#instrumentation-scope-1) | X | + | + | - | - | - | - | - | + | - | - | - |
| [otel_scope_info and labels can be disabled](specification/compatibility/prometheus_and_openmetrics.md#instrumentation-scope-1) | X | + | - | - | - | - | - | - | + | - | - | - |
| [otel_scope_[attribute] labels on all Metrics](specification/compatibility/prometheus_and_openmetrics.md#instrumentation-scope-1) | | + | - | - | - | - | - | - | - | - | - | - |
| [otel_scope labels can be disabled](specification/compatibility/prometheus_and_openmetrics.md#instrumentation-scope-1) | X | + | - | - | - | - | - | - | + | - | - | - |
Comment thread
dashpole marked this conversation as resolved.
| [Gauges become Prometheus Gauges](specification/compatibility/prometheus_and_openmetrics.md#gauges-1) | | + | + | + | + | - | - | - | + | + | + | - |
| [Cumulative Monotonic Sums become Prometheus Counters](specification/compatibility/prometheus_and_openmetrics.md#sums) | | + | + | + | + | - | - | - | + | + | + | + |
| [Prometheus Counters have _total suffix by default](specification/compatibility/prometheus_and_openmetrics.md#sums) | | + | + | + | + | - | - | - | + | - | - | - |
Expand Down
40 changes: 15 additions & 25 deletions specification/compatibility/prometheus_and_openmetrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,19 +166,14 @@ exemplar as attributes.

### Instrumentation Scope

The `otel_scope_name` and `otel_scope_version` lables, if present, SHOULD be
dropped from all metric points and used as the Instrumentation Scope name and
version respectively. All `otel_scope_info` metrics present in a batch
of metrics SHOULD be dropped from the incoming scrape. Labels on
`otel_scope_info` metric points other than `otel_scope_name` and
`otel_scope_version`, MUST be added as scope attributes to the scope with the
matching name and version. For example, the OpenMetrics text-formatted metrics:
Labels with `otel_scope_` prefix MUST be dropped from all metric points
and used as the Instrumentation Scope name (`otel_scope_name`),
version (`otel_scope_version`), schema URL (`otel_scope_schema_url`),
attributes (`otel_scope_[attribute]`).
Comment thread
lmolkova marked this conversation as resolved.
Comment thread
pellared marked this conversation as resolved.

```
# TYPE otel_scope_info info
otel_scope_info{otel_scope_name="go.opentelemetry.io.contrib.instrumentation.net.http.otelhttp",otel_scope_version="v0.24.0",library_mascot="bear"} 1
# TYPE http_server_duration counter
http_server_duration{otel_scope_name="go.opentelemetry.io.contrib.instrumentation.net.http.otelhttp",otel_scope_version="v0.24.0"...} 1
http_server_duration{otel_scope_name="go.opentelemetry.io.contrib.instrumentation.net.http.otelhttp",otel_scope_schema_url="https://opentelemetry.io/schemas/1.31.0",otel_scope_version="v0.24.0",otel_scope_library_mascot="gopher"...} 1
```

becomes:
Expand All @@ -190,7 +185,8 @@ scope_metrics:
name: go.opentelemetry.io.contrib.instrumentation.net.http.otelhttp
version: v0.24.0
attributes:
library_mascot: bear
library_mascot: gopher
schema_url: https://opentelemetry.io/schemas/1.31.0
metrics:
- name: http_server_duration
data:
Expand All @@ -199,7 +195,7 @@ scope_metrics:
- value: 1
```

Metrics which do not have an `otel_scope_name` or `otel_scope_version` label
Metrics which do not have any label with `otel_scope_` prefix
MUST be assigned an instrumentation scope identifying the entity performing
the translation from Prometheus to OpenTelemetry (e.g. the collector's
prometheus receiver).
Comment thread
pellared marked this conversation as resolved.
Expand Down Expand Up @@ -280,19 +276,13 @@ It also dictates type-specific conversion rules listed below.

### Instrumentation Scope

Prometheus exporters SHOULD generate an [Info](https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#info)-typed
metric named `otel_scope_info` for each Instrumentation Scope with non-empty
scope attributes. If present, Instrumentation Scope `name` and `version` MUST
be added as `otel_scope_name` and `otel_scope_version` labels. Scope attributes
MUST also be added as labels following the rules described in the
[`Metric Attributes`](#metric-attributes) section below.

Prometheus exporters MUST add the scope name as the `otel_scope_name` label and
the scope version as the `otel_scope_version` label on all metric points by
default, based on the scope the original data point was nested in.

Prometheus exporters SHOULD provide a configuration option to disable the
`otel_scope_info` metric and `otel_scope_` labels.
Prometheus exporters MUST by default add
the scope name as the `otel_scope_name` label,
the scope version as the `otel_scope_version` label,
the scope schema URL as the `otel_scope_schema_url` label,
the scope attributes as labels with `otel_scope_` prefix and following the rules
described in the [`Metric Attributes`](#metric-attributes) section below,
on all metric points, based on the scope the original data point was nested in.

### Gauges

Expand Down
4 changes: 2 additions & 2 deletions specification/metrics/sdk_exporters/prometheus.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ or UNIT metadata. The option MAY be named `without_units`, and MUST be `false` b
A Prometheus Exporter MAY support a configuration option to produce metrics without a [type suffix](../../compatibility/prometheus_and_openmetrics.md#metric-metadata).
The option MAY be named `without_type_suffix`, and MUST be `false` by default.

A Prometheus Exporter MAY support a configuration option to produce metrics without a [scope info](../../compatibility/prometheus_and_openmetrics.md#instrumentation-scope-1)
metric, or scope labels. The option MAY be named `without_scope_info`, and MUST be `false` by default.
A Prometheus Exporter MAY support a configuration option to produce metrics without [scope labels](../../compatibility/prometheus_and_openmetrics.md#instrumentation-scope-1).
Comment thread
pellared marked this conversation as resolved.
The option MAY be named `without_scope_info`, and MUST be `false` by default.
Comment thread
pellared marked this conversation as resolved.

A Prometheus Exporter MAY support a configuration option to produce metrics without a [target info](../../compatibility/prometheus_and_openmetrics.md#resource-attributes-1)
metric. The option MAY be named `without_target_info`, and MUST be `false` by default.
Loading