Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for: INFO type #622

Open
maestroi opened this issue Apr 18, 2024 · 0 comments
Open

Support for: INFO type #622

maestroi opened this issue Apr 18, 2024 · 0 comments

Comments

@maestroi
Copy link

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 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant