-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Prometheus receiver spec compliance tracker #25865
Comments
@open-telemetry/wg-prometheus |
Metric Name
Configuration to trim suffixes:
Name is unaltered by default, unless configured to trim suffixes: opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/metricfamily.go Lines 317 to 321 in 40d8176
This is compliant with the specification |
Metric Unit
Unit is converted to the unit of the OTLP: opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/metricfamily.go Line 323 in 40d8176
The unit is NOT translated from Prometheus conventions to OTel conventions Tracked by #23208 |
Metric Description
opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/metricfamily.go Line 322 in 40d8176
This is compliant with the specification |
Metric Type
The type is used to determine the OTel metric type. The individual types will be verified below: opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/metricfamily.go Line 327 in 40d8176
This is compliant with the specification |
Counters
Counters become monotonic sums: opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/util.go Lines 101 to 103 in 36c2759
This is compliant with the specification |
Gauges
opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/util.go Lines 105 to 106 in 36c2759
This is compliant with the specification |
Info and StateSet
Info and StateSet become non-monotonic sums: opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/util.go Lines 115 to 116 in 36c2759
This is compliant with the specification |
Unknown-typed
opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/util.go Lines 105 to 106 in 36c2759
This is compliant with the specification |
Histograms
opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/util.go Lines 107 to 108 in 36c2759
opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/metricfamily.go Line 292 in 36c2759
We do not validate that the histogram bucket series ends in _bucket. We assume that any series that isn't a sum, count, or created is the _bucket series. I think this is compliant with the specification. le label is used for bucket boundary: opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/util.go Lines 76 to 83 in 36c2759
The +inf bucket is ignored: opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/metricfamily.go Line 108 in 36c2759
opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/metricfamily.go Lines 280 to 298 in 36c2759
opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/metricfamily.go Lines 89 to 92 in 36c2759
opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/metricfamily.go Line 138 in 36c2759
This is compliant with the specification |
Summaries
opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/util.go Lines 113 to 114 in 36c2759
We use the quantile label: opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/util.go Lines 84 to 88 in 36c2759
It is used to populate the quantile of the resulting summary: opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/metricfamily.go Line 190 in 36c2759
We do not validate that the quantile has no suffix. We do ensure it does not have other relevant suffixes (sum, count, created). I believe this still complies with the spec, as non-suffixed metrics are used to identify quantiles.
opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/metricfamily.go Lines 280 to 298 in 36c2759
opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/metricfamily.go Lines 168 to 174 in 36c2759
opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/metricfamily.go Line 183 in 36c2759
The sum is unset, which is the same as setting to zero. This is compliant with the specification |
Dropped Types
opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/util.go Lines 117 to 122 in 36c2759
This is compliant with the specification |
Start Time
Histogram + Summary: opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/metricfamily.go Lines 290 to 291 in 36c2759
Counter: opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/metricfamily.go Lines 300 to 301 in 36c2759
this logic is complex, and is implemented in metrics_adjuster.go.
opentelemetry-collector-contrib/receiver/prometheusreceiver/config.go Lines 37 to 43 in 36c2759
This is compliant with the specification |
Exemplars
We implement the AppendExemplar function to get exemplars provided on series. opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/transaction.go Line 153 in 36c2759
Exemplars are set on histograms: opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/metricfamily.go Line 156 in 36c2759
Exemplars are set on counters: opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/metricfamily.go Line 236 in 36c2759
opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/metricfamily.go Line 383 in 36c2759
opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/metricfamily.go Lines 25 to 26 in 36c2759
opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/metricfamily.go Lines 386 to 406 in 36c2759
This is compliant with the specification |
Instrumentation Scope
Related: open-telemetry/opentelemetry-specification#3660 This is not implemented |
Resource Attributes
opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/prom_to_otlp.go Lines 35 to 48 in 36c2759
opentelemetry-collector-contrib/receiver/prometheusreceiver/internal/transaction.go Lines 271 to 282 in 36c2759
This is compliant with the specification |
I realized we actually do drop summaries and histograms without a count. I've updated the summary and histogram comments above with the reference. open-telemetry/opentelemetry-specification#3666 is no longer needed |
The prometheus receiver is now fully compliant with the prometheus specification |
Component(s)
receiver/prometheus
Describe the issue you're reporting
Validate and ensure compliance of the prometheus receiver with https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/compatibility/prometheus_and_openmetrics.md#prometheus-metric-points-to-otlp
Issues tracking spec-noncompliant behavior:
pkg.translator.prometheus.NormalizeName
feature gate #23208The text was updated successfully, but these errors were encountered: