prometheus / prometheus/common

Support for: INFO type

Open
#622 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
295
Forks
367
Avg merge
2d 10h
Merged PRs (30d)
18

Description

Hi Valuable opensource contributer.

I'm trying to parse a prometheus endpoint from a program, unfortunately it has a INFO as first metric.
This will just errors the complete parsing of all metrics, which in turn give me no map of metrics to work with.

Are there plants to add this in the library or a plan to just skip those non supported metrics?

Version:
github.com/prometheus/common v0.52.3

Import:
github.com/prometheus/common/expfmt

Feature supported according to docs:
No

No support for the following (optional) features: info type, stateset type, gaugehistogram type.

Error:
text format parsing error in line 2: unknown metric type "info"

Code:
func ParseMetricFamily(body string) (map[string]*dto.MetricFamily, error) { var parser expfmt.TextParser mf, err := parser.TextToMetricFamilies(strings.NewReader(body)) fmt.Println(mf) if err != nil { fmt.Println(err) return nil, err } return mf, nil }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the expfmt.TextParser and TextToMetricFamilies entry points shown in the report, then inspect how metric types are recognized and rejected. Done means an endpoint containing an INFO metric is handled according to the chosen behavior—supported or skipped—without preventing the remaining metrics from being parsed.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.