Skip to content

Commit

Permalink
Document implications of negative observations
Browse files Browse the repository at this point in the history
Signed-off-by: beorn7 <[email protected]>
  • Loading branch information
beorn7 committed May 26, 2021
1 parent a7515ca commit f34145a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion prometheus/histogram.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 47,12 @@ type Histogram interface {
Metric
Collector

// Observe adds a single observation to the histogram.
// Observe adds a single observation to the histogram. Observations are
// usually positive or zero. Negative observations are accepted but
// prevent current versions of Prometheus from properly detecting
// counter resets in the sum of observations. See
// https://prometheus.io/docs/practices/histograms/#count-and-sum-of-observations
// for details.
Observe(float64)
}

Expand Down
7 changes: 6 additions & 1 deletion prometheus/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 55,12 @@ type Summary interface {
Metric
Collector

// Observe adds a single observation to the summary.
// Observe adds a single observation to the summary. Observations are
// usually positive or zero. Negative observations are accepted but
// prevent current versions of Prometheus from properly detecting
// counter resets in the sum of observations. See
// https://prometheus.io/docs/practices/histograms/#count-and-sum-of-observations
// for details.
Observe(float64)
}

Expand Down

0 comments on commit f34145a

Please sign in to comment.