telegraf icon indicating copy to clipboard operation
telegraf copied to clipboard

Support for OpenMetrics standard

Open sirainen opened this issue 4 years ago • 5 comments

Feature Request

Telegraf supports Prometheus format, which was used as the basis for the OpenMetrics standard. However, there are some differences. Most importantly from my point of view, Dovecot v2.3.14+ uses the "info" type, which Telegraf treats as invalid. It would be nice if Telegraf would add support for this to make it more OpenMetrics standard compliant. (This can't be fixed on Dovecot side without making it violate the OpenMetrics standard, or adding a new configuration option to choose the behavior.)

See https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md

sirainen avatar Jul 27 '21 17:07 sirainen

next steps: look into creating a new parser using the existing Prometheus parser as a foundation to correctly parse the new features like info.

powersj avatar Apr 19 '22 20:04 powersj

Hello, I have an upcoming project where I'm interested in using telegraf with OpenMetrics. I'm wondering if this is on the roadmap for any time soon Thank you

jadbaz avatar Sep 03 '22 08:09 jadbaz

We have also issues with consuming different OpenMetrics endpoints. Have trouble with timestamp format. Currently [[inputs.prometheus]] only accepts milliseconds timestamp (prometheus format specification).

OpenMetrics describes another timestamp format: Timestamps MUST be Unix Epoch in seconds. You can use milli- or nanoseconds precision with a float64 like: 1520879607.123 or 1520879607.123456

Maybe it's possible to add also this timestamp format to [[inputs.prometheus]], so that we can already consume metrics from OpenMetrics endpoints till telegraf officially supports OpenMetrics format?

1tft avatar Nov 03 '23 13:11 1tft

So we identified following main differences/evolution to prometheus format:

  • new Info and StateSet type
  • timestamp format (Unix Epoch in seconds. You can use milli- or nanoseconds precision with a float64 like: 1520879607.123 or 1520879607.123456)

Short summary OpenMetrics vs. Prometheus format: https://www.robustperception.io/openmetrics-is-released/

1tft avatar Jan 30 '24 16:01 1tft