Skip to content

Commit

Permalink
Replace gauge value instead of summing (#1)
Browse files Browse the repository at this point in the history
* Replace gauge value instead of summing
* Disable helm deploy workflow
  • Loading branch information
tsotnikov authored Nov 26, 2024
1 parent 1d246ea commit 441e116
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/on_merge.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: continuous deploy

on:
push:
branches:
- main
workflow_dispatch:
# push:
# branches:
# - main

jobs:
release-charts:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions metrics/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
}

Expand Down

0 comments on commit 441e116

Please sign in to comment.