Decode calls the Decode method of the wrapped Decoder and then extracts the samples from the decoded MetricFamily into the provided model.Vector.
(s *model.Vector)
| 261 | // Decode calls the Decode method of the wrapped Decoder and then extracts the |
| 262 | // samples from the decoded MetricFamily into the provided model.Vector. |
| 263 | func (sd *SampleDecoder) Decode(s *model.Vector) error { |
| 264 | err := sd.Dec.Decode(&sd.f) |
| 265 | if err != nil { |
| 266 | return err |
| 267 | } |
| 268 | *s, err = extractSamples(&sd.f, sd.Opts) |
| 269 | return err |
| 270 | } |
| 271 | |
| 272 | // ExtractSamples builds a slice of samples from the provided metric |
| 273 | // families. If an error occurs during sample extraction, it continues to |