prom2json icon indicating copy to clipboard operation
prom2json copied to clipboard

Add OpenMetrics support

Open n-peugnet opened this issue 10 months ago • 2 comments

Hi, I wanted to use prom2json to convert the output of promtool tsdb dump-openmetrics, but I get the following error:

error reading metrics: reading text format failed: text format parsing error in line 1: expected integer as timestamp, got "1739184970.553"

Here is the corresponding line:

go_gc_duration_seconds{instance="node5",job="file_discovery",quantile="0.0"} 0 1739184970.553

As I understand it, this comes from a breaking change between Prometheus exposition format and the OpenMetrics one that the timestamp must be in seconds.

Is parsing OpenMetrics format in the scope of prom2json?

n-peugnet avatar Feb 10 '25 18:02 n-peugnet

OK, so from what I understand, this is currently blocked by https://github.com/prometheus/common/pull/669.

n-peugnet avatar Feb 11 '25 10:02 n-peugnet

Yes, sounds about right.

beorn7 avatar Feb 11 '25 20:02 beorn7