File tree 1 file changed +18
-2
lines changed 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):
441
441
self ._created = time .time ()
442
442
443
443
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
+ """
445
453
self ._count .inc (1 )
446
454
self ._sum .inc (amount )
447
455
@@ -550,7 +558,15 @@ def _metric_init(self):
550
558
)
551
559
552
560
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
+ """
554
570
self ._sum .inc (amount )
555
571
for i , bound in enumerate (self ._upper_bounds ):
556
572
if amount <= bound :
You can’t perform that action at this time.
0 commit comments