diff --git a/README.md b/README.md index 4775683..b2813e1 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Prometheus Aggregation Gateway is a push gateway that aggregates metrics for Pro * Counters where all labels match are added up. * Histograms are added up; if bucket boundaries are mismatched then the result has the union of all buckets and counts are given to the lowest bucket that fits. -* Gauges are also added up (but this may not make any sense) +* Gauges are replaced * Summaries are treated as a pair of counters (quantile information is discarded if present). ## How to use diff --git a/metrics/merge.go b/metrics/merge.go index f8ce8ff..7097c57 100644 --- a/metrics/merge.go +++ b/metrics/merge.go @@ -82,13 +82,10 @@ func mergeMetric(ty dto.MetricType, a, b *dto.Metric) *dto.Metric { } case dto.MetricType_GAUGE: - // No very meaningful way for us to merge gauges. We'll sum them - // and clear out any gauges on scrape, as a best approximation, but - // this relies on client pushing with the same interval as we scrape. return &dto.Metric{ Label: a.Label, Gauge: &dto.Gauge{ - Value: float64ptr(*a.Gauge.Value + *b.Gauge.Value), + Value: float64ptr(*b.Gauge.Value), }, }