prometheus / prometheus/prom2json
Add OpenMetrics support
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 411
- Forks
- 94
- PR merge metrics
- No merged PRs in 30d
Description
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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the text-format parser used when prom2json reads output from promtool tsdb dump-openmetrics, then reproduce the reported decimal-timestamp failure with the example metric. Check the existing parser tests and define done as accepting OpenMetrics timestamps without breaking current Prometheus exposition parsing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, prometheus
- Domain
- cli, observability
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100