MCPcopy
hub / github.com/grafana/tempo / resolveSeries

Function resolveSeries

modules/generator/registry/counter.go:90–106  ·  view source on GitHub ↗
(series map[uint64]*T, hash uint64, lbls labels.Labels, lifecycler Limiter, count uint32)

Source from the content-addressed store, hash-verified

88}
89
90func resolveSeries[T any](series map[uint64]*T, hash uint64, lbls labels.Labels, lifecycler Limiter, count uint32) (*T, labels.Labels, uint64) {
91 // If we already track the series, return it.
92 if existing, ok := series[hash]; ok {
93 return existing, lbls, hash
94 }
95
96 // Otherwise, we need to let the lifecycler decide which labels to use
97 lbls, hash = lifecycler.OnAdd(hash, count, lbls)
98
99 // The lifecycler may have changed the labels, so we need to check again.
100 if existing, ok := series[hash]; ok {
101 return existing, lbls, hash
102 }
103
104 // Finally, we may still have a new series, so it will need to be created by the caller.
105 return nil, lbls, hash
106}
107
108func (c *counter) newSeries(lbls labels.Labels, value float64) *counterSeries {
109 return &counterSeries{

Callers 4

IncMethod · 0.85
ObserveWithExemplarMethod · 0.85
ObserveWithExemplarMethod · 0.85
updateSeriesMethod · 0.85

Calls 1

OnAddMethod · 0.65

Tested by

no test coverage detected