Reputation: 7796
From the prometheus python documentation, let's say I run this:
from prometheus_client import Counter
c = Counter('my_failures', 'Description of counter')
c.inc() # Increment by 1
c.inc(1.6) # Increment by given value
How might I get the value of the c
metric after performing both of these increments? This is for testing purposes, I want to be able to test
c.value == 2.6
Except I can't seem to find a value accessor.
Is this even possible, or should I find another way?
Upvotes: 1
Views: 4439
Reputation: 3031
From the source code, it looks like you can access it by _value
attribute:
c._value.get() == 2.6
Upvotes: 4