| 18 | ) |
| 19 | |
| 20 | type nativeHistogram struct { |
| 21 | metricName string |
| 22 | |
| 23 | // TODO: we can also switch to a HistrogramVec and let prometheus handle the labels. This would remove the series map |
| 24 | // and all locking around it. |
| 25 | // Downside: you need to list labels at creation time while our interfaces only pass labels at observe time, this |
| 26 | // will requires a bigger refactor, maybe something for a second pass? |
| 27 | // Might break processors that have variable amount of labels... |
| 28 | // promHistogram prometheus.HistogramVec |
| 29 | |
| 30 | seriesMtx sync.Mutex |
| 31 | series map[uint64]*nativeHistogramSeries |
| 32 | seriesDemand *Cardinality |
| 33 | |
| 34 | lifecycler Limiter |
| 35 | |
| 36 | buckets []float64 |
| 37 | |
| 38 | traceIDLabelName string |
| 39 | |
| 40 | // Can be "native", classic", "both" to determine which histograms to |
| 41 | // generate. A diff in the configured value on the processors will cause a |
| 42 | // reload of the process, and a new instance of the histogram to be created. |
| 43 | histogramOverride HistogramMode |
| 44 | |
| 45 | overrides Overrides |
| 46 | // The tenant for this registry instance is received at create time and does not change. |
| 47 | tenant string |
| 48 | |
| 49 | externalLabels map[string]string |
| 50 | |
| 51 | // classic |
| 52 | nameCount string |
| 53 | nameSum string |
| 54 | nameBucket string |
| 55 | } |
| 56 | |
| 57 | type nativeHistogramSeries struct { |
| 58 | // labels should not be modified after creation |
nothing calls this directly
no outgoing calls
no test coverage detected