File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -441,7 +441,15 @@ def _metric_init(self):
441441 self ._created = time .time ()
442442
443443 def observe (self , amount ):
444- """Observe the given amount."""
444+ """Observe the given amount.
445+
446+ The amount is usually positive or zero. Negative values are
447+ accepted but prevent current versions of Prometheus from
448+ properly detecting counter resets in the sum of
449+ observations. See
450+ https://prometheus.io/docs/practices/histograms/#count-and-sum-of-observations
451+ for details.
452+ """
445453 self ._count .inc (1 )
446454 self ._sum .inc (amount )
447455
@@ -550,7 +558,15 @@ def _metric_init(self):
550558 )
551559
552560 def observe (self , amount ):
553- """Observe the given amount."""
561+ """Observe the given amount.
562+
563+ The amount is usually positive or zero. Negative values are
564+ accepted but prevent current versions of Prometheus from
565+ properly detecting counter resets in the sum of
566+ observations. See
567+ https://prometheus.io/docs/practices/histograms/#count-and-sum-of-observations
568+ for details.
569+ """
554570 self ._sum .inc (amount )
555571 for i , bound in enumerate (self ._upper_bounds ):
556572 if amount <= bound :
You can’t perform that action at this time.
0 commit comments