Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for exemplars on OpenMetrics counters #2483

Merged
merged 3 commits into from
Apr 19, 2022
Merged
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
22 changes: 12 additions & 10 deletions specification/metrics/datamodel.md
Original file line number Diff line number Diff line change
Expand Up @@ -1192,8 +1192,10 @@ Prometheus Cumulative metrics do not include the start time of the metric. When
#### Exemplars

[OpenMetrics 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. If present, the timestamp
can be attached to Prometheus Histogram bucket metric points and counter metric
points. Exemplars on histogram buckets SHOULD be converted to exemplars on
OpenTelemetry histograms. Exemplars on counter metric points SHOULD be
converted to exemplars on OpenTelemetry sums. If present, the timestamp
MUST be added to the OpenTelemetry exemplar. The Trace ID and Span ID SHOULD be
retrieved from the `trace_id` and `span_id` label keys, respectively. All
labels not used for the trace and span ids MUST be added to the OpenTelemetry
Expand Down Expand Up @@ -1305,14 +1307,14 @@ OpenTelemetry Metric Attributes MUST be converted to [Prometheus labels](https:/

#### Exemplars

[Exemplars](#exemplars) on OpenTelemetry Histograms SHOULD be converted to
OpenMetrics 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.
[Exemplars](#exemplars) on OpenTelemetry Histograms and Monotonic Sums SHOULD
be converted to OpenMetrics 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.
OpenMetrics Exemplars MUST use the `trace_id` and `span_id` keys for the trace
and span IDs, respectively. Timestamps MUST be added as timestamps on the
OpenMetrics exemplar, and `filtered_attributes` MUST be added as labels on the
Expand Down