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

Method NewHistogram

modules/generator/registry/registry.go:200–214  ·  view source on GitHub ↗
(name string, buckets []float64, histogramOverride HistogramMode)

Source from the content-addressed store, hash-verified

198}
199
200func (r *ManagedRegistry) NewHistogram(name string, buckets []float64, histogramOverride HistogramMode) (h Histogram) {
201 traceIDLabelName := r.overrides.MetricsGeneratorTraceIDLabelName(r.tenant)
202
203 // TODO: Temporary switch: use the old implementation when native histograms
204 // are disabled, eventually the new implementation can handle all cases
205
206 if hasNativeHistograms(histogramOverride) {
207 h = newNativeHistogram(name, buckets, r, traceIDLabelName, histogramOverride, r.externalLabels, r.tenant, r.overrides, r.cfg.StaleDuration)
208 } else {
209 h = newHistogram(name, buckets, r, traceIDLabelName, r.externalLabels, r.cfg.StaleDuration)
210 }
211
212 r.registerMetric(h)
213 return h
214}
215
216func (r *ManagedRegistry) NewGauge(name string) Gauge {
217 g := newGauge(name, r, r.externalLabels, r.cfg.StaleDuration)

Callers

nothing calls this directly

Calls 5

registerMetricMethod · 0.95
hasNativeHistogramsFunction · 0.85
newNativeHistogramFunction · 0.85
newHistogramFunction · 0.85

Tested by

no test coverage detected