Observability/metrics update (#1962)
* Removing logging from the NOOP implementatino * Simplifying the percentiles option * Simple logging implementation Co-authored-by: chris <chris@Profanity.local>
This commit is contained in:
@@ -19,13 +19,22 @@ type metricFamily struct {
|
||||
|
||||
// newMetricFamily returns a new metricFamily (useful in case we want to change the structure later):
|
||||
func (r *Reporter) newMetricFamily() metricFamily {
|
||||
|
||||
// Take quantile thresholds from our pre-defined list:
|
||||
timingObjectives := make(map[float64]float64)
|
||||
for _, percentile := range r.options.Percentiles {
|
||||
if quantileThreshold, ok := quantileThresholds[percentile]; ok {
|
||||
timingObjectives[percentile] = quantileThreshold
|
||||
}
|
||||
}
|
||||
|
||||
return metricFamily{
|
||||
counters: make(map[string]*prometheus.CounterVec),
|
||||
gauges: make(map[string]*prometheus.GaugeVec),
|
||||
timings: make(map[string]*prometheus.SummaryVec),
|
||||
defaultLabels: r.convertTags(r.options.DefaultTags),
|
||||
prometheusRegistry: r.prometheusRegistry,
|
||||
timingObjectives: r.options.TimingObjectives,
|
||||
timingObjectives: timingObjectives,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user