pushgateway icon indicating copy to clipboard operation
pushgateway copied to clipboard

Support for the OpenMetrics format

Open atheriel opened this issue 4 years ago • 3 comments

Feature request

Currently the Pushgateway can only accept and emit metrics using Prometheus's original text format. There is no support for the new OpenMetrics format, even though Prometheus itself (and a growing number of clients) are moving to this format.

I don't have a strong argument for this feature, other than the merits of the OpenMetrics format itself -- in particular I'd love to have support for exemplars.

In addition, since Pushgateway uses Prometheus's own Golang libraries, this is probably not too hard to achieve -- it has been supported with an opt-in flag since 1.4.0, released more than a year ago.

atheriel avatar Apr 14 '21 18:04 atheriel

The feature request is legitimate, but it depends on support in https://github.com/prometheus/common . The latter already has https://github.com/prometheus/common/blob/main/expfmt/openmetrics_create.go , which is used by client_golang to expose OpenMetrics (if so requested, and within certain limitations). However, what's missing is https://github.com/prometheus/common/blob/main/expfmt/openmetrics_parse.go , i.e. parsing OpenMetrics text format into protobuf DTOs. (The OpenMetrics parser in Prometheus itself is different as it directly parses OpenMetrics into the form needed for ingestion into TSDB.)

beorn7 avatar Apr 15 '21 14:04 beorn7

That makes sense.

atheriel avatar Apr 15 '21 14:04 atheriel

(For those waiting for this like me) work for this has started here https://github.com/prometheus/common/pull/669 🎉

jcarrag avatar Sep 05 '24 07:09 jcarrag