MCPcopy
hub / github.com/prometheus/client_golang / Write

Method Write

prometheus/wrap.go:205–221  ·  prometheus/wrap.go::wrappingMetric.Write
(out *dto.Metric)

Source from the content-addressed store, hash-verified

203}
204
205func (m *wrappingMetric) Write(out *dto.Metric) error {
206 if err := m.wrappedMetric.Write(out); err != nil {
207 return err
208 }
209 if len(m.labels) == 0 {
210 // No wrapping labels.
211 return nil
212 }
213 for ln, lv := range m.labels {
214 out.Label = append(out.Label, &dto.LabelPair{
215 Name: proto.String(ln),
216 Value: proto.String(lv),
217 })
218 }
219 sort.Sort(internal.LabelPairSorter(out.Label))
220 return nil
221}
222
223func wrapDesc(desc *Desc, prefix string, labels Labels) *Desc {
224 constLabels := Labels{}

Callers

nothing calls this directly

Calls 3

LabelPairSorterTypeAlias · 0.92
WriteMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected