(out *dto.Metric)
| 203 | } |
| 204 | |
| 205 | func (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 | |
| 223 | func wrapDesc(desc *Desc, prefix string, labels Labels) *Desc { |
| 224 | constLabels := Labels{} |
nothing calls this directly
no test coverage detected