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

Function FromLabelsToLabelAdapters

pkg/cortexpb/compat.go:112–114  ·  view source on GitHub ↗

FromLabelsToLabelAdapters casts labels.Labels to []LabelAdapter. It uses unsafe, but as LabelAdapter == labels.Label this should be safe. This allows us to use labels.Labels directly in protos.

(ls labels.Labels)

Source from the content-addressed store, hash-verified

110// It uses unsafe, but as LabelAdapter == labels.Label this should be safe.
111// This allows us to use labels.Labels directly in protos.
112func FromLabelsToLabelAdapters(ls labels.Labels) []LabelAdapter {
113 return *(*[]LabelAdapter)(unsafe.Pointer(&ls))
114}
115
116// FromLabelAdaptersToMetric converts []LabelAdapter to a model.Metric.
117// Don't do this on any performance sensitive paths.

Callers 15

makeWriteRequestExemplarFunction · 0.92
TestMergeExemplarsFunction · 0.92
prepareSeriesKeysMethod · 0.92
NewParquetQueryableFunction · 0.92
fetchSeriesFromStoresMethod · 0.92
decodeSampleStreamFunction · 0.92
decodeSampleFunction · 0.92
generateDataFunction · 0.92
TestMergeSampleStreamsFunction · 0.92
queryExemplarsMethod · 0.92

Calls

no outgoing calls