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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ release.
([#4963](https://github.com/open-telemetry/opentelemetry-specification/pull/4963))
- Stabilize Prometheus Exemplar to OpenTelemetry Exemplar transformation.
([#4962](https://github.com/open-telemetry/opentelemetry-specification/pull/4962))
- Stabilize Prometheus Metadata transformation.
([#4954](https://github.com/open-telemetry/opentelemetry-specification/pull/4954))

### SDK Configuration

Expand Down
41 changes: 33 additions & 8 deletions specification/compatibility/prometheus_and_openmetrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,43 @@ at the time of writing:

### Metric Metadata

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

The [Prometheus Metric Name](https://prometheus.io/docs/instrumenting/exposition_formats/#comments-help-text-and-type-information)
MUST be added as the Name of the OTLP metric. By default, the name SHOULD NOT be altered, but translation SHOULD provide configuration which, when enabled, removes type (e.g. `_total`) and unit (e.g. `_seconds`) suffixes.
MUST be added as the Name of the OTLP metric. The name SHOULD NOT be altered.

[Prometheus UNIT metadata](https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#metricfamily),
if present, MUST be converted to the unit of the OTLP metric. The unit SHOULD
be translated from Prometheus conventions to OpenTelemetry conventions by:

* Converting from full words to abbreviations (e.g. "milliseconds" to "ms").
* Special case: Converting "ratio" to "1".
* Converting "foo_per_bar" to "foo/bar".
if present, MUST be converted to the unit of the OTLP metric. The unit MUST
be translated from words to the UCUM abbreviation if it is in the following set
of commonly-used units:

| Prometheus Unit | UCUM Abbreviation |
| :--- | :--- |
| `days` | `d` |
| `hours` | `h` |
| `minutes` | `min` |
| `seconds` | `s` |
| `milliseconds` | `ms` |
| `microseconds` | `us` |
| `nanoseconds` | `ns` |
| `bytes` | `By` |
| `kibibytes` | `KiBy` |
| `mebibytes` | `MiBy` |
| `gibibytes` | `GiBy` |
| `tebibytes` | `TiBy` |
| `kilobytes` | `kBy` |
| `megabytes` | `MBy` |
| `gigabytes` | `GBy` |
| `terabytes` | `TBy` |
| `meters` | `m` |
| `volts` | `V` |
| `amperes` | `A` |
| `joules` | `J` |
| `watts` | `W` |
| `grams` | `g` |
| `celsius` | `Cel` |
| `hertz` | `Hz` |
| `percent` | `%` |

[Prometheus HELP metadata](https://prometheus.io/docs/instrumenting/exposition_formats/#comments-help-text-and-type-information),
if present, MUST be added as the description of the OTLP metric.
Expand Down
Loading