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
Specify how to handle prometheus exemplar timestamp and attributes (#2376)
* specify how to handle prometheus exemplar timestamp and attributes
* formatting and handle exceeding the character limit
Co-authored-by: Joshua MacDonald <[email protected]>
Copy file name to clipboardExpand all lines: specification/metrics/datamodel.md
+20-2
Original file line number
Diff line number
Diff line change
@@ -1166,7 +1166,13 @@ Prometheus Cumulative metrics do not include the start time of the metric. When
1166
1166
1167
1167
#### Exemplars
1168
1168
1169
-
[Prometheus Exemplars](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#exemplars) can be attached to Prometheus Histogram bucket metrics, which SHOULD be converted to exemplars on OpenTelemetry histograms. The Trace ID and Span ID SHOULD be retrieved from the `trace_id` and `span_id` label keys, respectively.
can be attached to Prometheus Histogram bucket metrics, which SHOULD be
1171
+
converted to exemplars on OpenTelemetry histograms. If present, the timestamp
1172
+
MUST be added to the OpenTelemetry exemplar. The Trace ID and Span ID SHOULD be
1173
+
retrieved from the `trace_id` and `span_id` label keys, respectively. All
1174
+
labels not used for the trace and span ids MUST be added to the OpenTelemetry
1175
+
exemplar as attributes.
1170
1176
1171
1177
#### Resource Attributes
1172
1178
@@ -1256,7 +1262,19 @@ OpenTelemetry Metric Attributes MUST be converted to [Prometheus labels](https:/
1256
1262
1257
1263
#### Exemplars
1258
1264
1259
-
[Exemplars](#exemplars) on OpenTelemetry Histograms SHOULD be converted to Prometheus exemplars. Exemplars on other OpenTelemetry data points MUST be dropped. For Prometheus push exporters, multiple exemplars are able to be added to each bucket, so all exemplars SHOULD be converted. For Prometheus pull endpoints, only a single exemplar is able to be added to each bucket, so the largest exemplar from each bucket MUST be used, if attaching exemplars. If no exemplars exist on a bucket, the highest exemplar from a lower bucket MUST be used, even though it is a duplicate of another bucket's exemplar. Prometheus Exemplars MUST use the `trace_id` and `span_id` keys for the trace and span IDs, respectively.
1265
+
[Exemplars](#exemplars) on OpenTelemetry Histograms SHOULD be converted to
1266
+
OpenMetrics exemplars. Exemplars on other OpenTelemetry data points MUST be
1267
+
dropped. For Prometheus push exporters, multiple exemplars are able to be
1268
+
added to each bucket, so all exemplars SHOULD be converted. For Prometheus
1269
+
pull endpoints, only a single exemplar is able to be added to each bucket, so
1270
+
the largest exemplar from each bucket MUST be used, if attaching exemplars. If
1271
+
no exemplars exist on a bucket, the highest exemplar from a lower bucket MUST
1272
+
be used, even though it is a duplicate of another bucket's exemplar.
1273
+
OpenMetrics Exemplars MUST use the `trace_id` and `span_id` keys for the trace
1274
+
and span IDs, respectively. Timestamps MUST be added as timestamps on the
1275
+
OpenMetrics exemplar, and `filtered_attributes` MUST be added as labels on the
1276
+
OpenMetrics exemplar unless they would exceed the OpenMetrics
1277
+
[limit on characters](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#exemplars).
0 commit comments