prober: make histogram buckets cumulative

Histogram buckets should include counts for all values under the bucket ceiling,
not just those between the ceiling and the next lower ceiling.

See https://prometheus.io/docs/tutorials/understanding_metric_types/\#histogram

Updates tailscale/corp#24522

Signed-off-by: Percy Wegmann <percy@tailscale.com>
This commit is contained in:
Percy Wegmann
2024-12-20 08:07:54 -06:00
committed by Percy Wegmann
parent 3adad364f1
commit 5095efd628
2 changed files with 1 additions and 2 deletions

View File

@@ -45,6 +45,5 @@ func (h *histogram) add(v float64) {
continue
}
h.bucketedCounts[b] += 1
break
}
}