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
SPEC: clarify what output format we require for /metrics #678
Comments
original thought on this was that we would require implementations to support Prometheus format text output from /metrics, but that they may also support OpenMetrics format... |
Transcribed from gitter... I see at least two use cases:
There seems to be no official IANA media type for either Prometheus or OpenMetrics. That said, Yet, there is evidence (code) that So, even though that is not an official cataloged media type according to IANA there does seem to be some use of it in the wild. We could consider Failing that, there's always a query parameter such as |
I see also at https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#iana-considerations-iana the following:
|
We need to decide whether we expect compliant implementations to export metrics in Prometheus format or OpenMetrics format.
The MP metrics spec, as currently written, says that it supports OpenMetrics text format, but in reality it supports Prometheus format (the Prometheus and OpenMetrics formats have diverged somewhat since the previous MP Metrics spec was written)
Micrometer's PrometheusMeterRegistry supports collecting scrapes in either Prometheus or OpenMetrics format (though at the moment the Units line and _created line found in OpenMetrics format are not supported), so it would be relatively easy for Micrometer-based implementations to accomodate exporting metrics in either format.
OpenTelemetry is discussing accepting and producing metrics in the OpenMetrics format (see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/semantic_conventions/openmetrics-guidelines.md), but also mentions it needs to interoperate with the Prometheus format.
I suggest we adopt the same approach here as is described in the OpenTelemetry spec (https://opentelemetry.io/docs/reference/specification/metrics/sdk_exporters/prometheus/) which says...
A Prometheus Exporter is a Pull Metric Exporter which reports metrics by responding to the Prometheus scraper requests.
A Prometheus Exporter MUST support Pull mode.
A Prometheus Exporter MUST NOT support Push mode.
A Prometheus Exporter MUST only support Cumulative Temporality.
A Prometheus Exporter MUST support version 0.0.4 of the Text-based format.
A Prometheus Exporter MAY support OpenMetrics Text Format, including the Exemplars.
The text was updated successfully, but these errors were encountered: