MCPcopy Create free account
hub / github.com/cortexproject/cortex / getNameAndAttributes

Function getNameAndAttributes

integration/e2ecortex/client.go:209–220  ·  view source on GitHub ↗
(ts prompb.TimeSeries)

Source from the content-addressed store, hash-verified

207}
208
209func getNameAndAttributes(ts prompb.TimeSeries) (string, map[string]any) {
210 var metricName string
211 attributes := make(map[string]any)
212 for _, label := range ts.Labels {
213 if label.Name == model.MetricNameLabel {
214 metricName = label.Value
215 } else {
216 attributes[label.Name] = label.Value
217 }
218 }
219 return metricName, attributes
220}
221
222func createDataPointsGauge(newMetric pmetric.Metric, attributes map[string]any, samples []prompb.Sample) {
223 newMetric.SetEmptyGauge()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected