You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specification/compatibility/prometheus_and_openmetrics.md
+14-16Lines changed: 14 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -466,34 +466,32 @@ to avoid conflicts with the already existing `otel_scope_name`, `otel_scope_vers
466
466
467
467
### Gauges
468
468
469
-
**Status**: [Development](../document-status.md)
469
+
**Status**: [Stable](../document-status.md)
470
470
471
-
An [OpenTelemetry Gauge](../metrics/data-model.md#gauge) MUST be converted to
472
-
a Prometheus Unknown-typed metric if the `prometheus.type` key of
473
-
[metric.metadata][metricMetadata] is `unknown`. Otherwise, it MUST be converted
474
-
to a Prometheus Gauge.
471
+
An [OpenTelemetry Gauge](../metrics/data-model#gauge) MUST be converted following
472
+
a hint present in [metric.metadata][metricMetadata]:
473
+
- If the `prometheus.type` key is absent, or its value is equal to `gauge`, the datapoint MUST be transformed to a Prometheus Gauge.
474
+
- If the `prometheus.type` key has value equal to `unkown`, the datapoint MUST be transformed to a Prometheus Unknown.
475
+
- If the `prometheus.type` key has value equal to `info`, the datapoint SHOULD be transformed to a Prometheus Info.
476
+
- If the `prometheus.type` key has value equal to `stateset`, the datapoint SHOULD be transformed to a Prometheus Stateset.
475
477
476
478
Exemplars on OpenTelemetry Gauges SHOULD be dropped.
477
479
478
480
### Sums
479
481
480
-
**Status**: [Development](../document-status.md)
482
+
**Status**: [Stable](../document-status.md)
481
483
482
-
[OpenTelemetry Sums](../metrics/data-model.md#sums) follows this logic:
484
+
An [OpenTelemetry Sum](../metrics/data-model.md#sums) MUST be converted following the rules below:
483
485
484
486
- If the aggregation temporality is cumulative and the sum is monotonic, it MUST be converted to a Prometheus Counter.
485
-
- If the aggregation temporality is cumulative and the sum is non-monotonic and the `prometheus.type` key of
486
-
[metric.metadata][metricMetadata] is `info`, it MUST be converted to an OpenMetrics Info metric.
487
-
- If the aggregation temporality is cumulative and the sum is non-monotonic and the `prometheus.type` key of
488
-
[metric.metadata][metricMetadata] is `stateset`, it MUST be converted to an OpenMetrics StateSet metric.
489
-
- If the aggregation temporality is cumulative and the sum is non-monotonic, it MUST be converted to a Prometheus Gauge.
490
-
- If the aggregation temporality is delta and the sum is monotonic, it SHOULD be converted to a cumulative temporality and become a Prometheus Counter. The following behaviors are expected:
487
+
- If the aggregation temporality is cumulative and the sum is non-monotonic, it should follow the same rules as described for [OpenTelemetry Gauge](#gauges-1)
488
+
- If the aggregation temporality is delta and the sum is monotonic, it MAY be converted to a cumulative temporality and become a Prometheus Counter. The following behaviors are expected:
491
489
- The new data point type must be the same as the accumulated data point type.
492
490
- The new data point's start time must match the time of the accumulated data point. If not, see [detecting alignment issues](../metrics/data-model.md#sums-detecting-alignment-issues).
493
-
- Otherwise, it MUST be dropped.
494
491
495
-
If the metric name for monotonic Sum metric points does not end in a suffix of `_total` a suffix of `_total` SHOULD be added by default, otherwise the name MUST remain unchanged. Exporters SHOULD provide a configuration option to disable the addition of `_total` suffixes.
496
-
Monotonic Sum metric points with `StartTimeUnixNano` should export the `{name}_created` metric as well.
492
+
If the metric name for monotonic Sum metric points does not end in a suffix of `_total` a suffix of `_total` SHOULD be added by default, otherwise the name MUST remain unchanged.
493
+
494
+
Monotonic Sum metric points with `StartTimeUnixNano` SHOULD transform `StartTimeUnixNano` into Prometheus `StartTime`, following the appropriate format used by each Prometheus protocol.
497
495
498
496
If Sum is converted to a Prometheus Counter, then `Exemplars` MUST be converted
499
497
as described in the [Exemplar Conversion](#exemplar-conversion) section.
0 commit comments