MCPcopy Create free account
hub / github.com/prometheus/common / Decode

Method Decode

expfmt/decode.go:189–198  ·  view source on GitHub ↗

Decode implements the Decoder interface.

(v *dto.MetricFamily)

Source from the content-addressed store, hash-verified

187
188// Decode implements the Decoder interface.
189func (d *openMetricsDecoder) Decode(v *dto.MetricFamily) error {
190 if d.err != nil {
191 return d.err
192 }
193 if err := d.p.next(v); err != nil {
194 d.err = err
195 return err
196 }
197 return nil
198}
199
200// openMetrics20Decoder implements the Decoder interface for the OpenMetrics 2.0 protocol.
201// Like openMetricsDecoder, it uses goabnf.ParseForest per line without a line-length

Callers

nothing calls this directly

Calls 1

nextMethod · 0.45

Tested by

no test coverage detected