client_python
client_python copied to clipboard
Prometheus instrumentation library for Python applications
I have an application that uses `Histogram`. I want to write some tests that assert that my application is putting values into the right buckets of that histogram. To read...
To reproduce: ``` from prometheus_client import Counter c = Counter("c", "c") c.inc() c.clear() ``` The error returned is: ``` AttributeError: 'Counter' object has no attribute '_lock' ``` Is using .clear()...
The documentation for this library is incomplete. It could really use some thorough API documentation. For example, what is a Registry? When does the collect method get called, and what...
I run flask app on Gunicorn 20.0.4 and Kubernetes. My python is v3.7.5. I have a problem with increasing CPU over a time.  After investigating stack traces using py-spy...
Hi! Faced strange situation with timestamps. Briefly: 1. If timestamp is taken from `datetime.datetime.now()` - everything is ok. 2. If timestamp is parsed from the date which looks same -...
In multiprocess mode calling 'remove' on a metric/label doesn't actually remove it from the metrics output. Also, because of the disconnect between the Metric classes's remove and MultiProcessValue, the following...
Hello. Tried to remove some childs, but got KeyError. My custom metric (gauge) have some lables and worked fine. But when i needed to delete some childs, i'm stuck: ```...
Usecase: ``` c = Counter("errors_count") @c.count_exceptions() def foo(): # counter = 1 raise Exception() @c.count_exceptions() async def foo_async(): # counter still 1 await sleep(1) raise Exception() ``` Quick search in...
:eyes: Some source code analysis tools can help to find opportunities for improving software components. :thought_balloon: I propose to [increase the usage of augmented assignment statements](https://docs.python.org/3/reference/simple_stmts.html#augmented-assignment-statements "Augmented assignment statements") accordingly....
I need to collect the **percentage** of **usage** of **CPU** and **RAM**. I've seen from the README that for Linux these metrics are available with the class `ProcessCollector`. Indeed I...