Skip to content

Support for: INFO type #622

Open
Open
@maestroi

Description

@maestroi

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 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions