claws / aioprometheus

A Prometheus Python client library for asyncio-based applications
174 stars 21 forks source link

To add gc_collectors metrics to the project as a basic (out of the box) functionality. #95

Open ArtyomKozyrev8 opened 9 months ago

ArtyomKozyrev8 commented 9 months ago

Hello I would like to have the same functionality (gc_collector metrics) out of the box as we have in prometheus-client package.

Can I try to create PR and add the functionality to the project? Or probably there is already such functionality (I could not find it in the repo code) and I can switch it on somehow?

The expected behavior:

# HELP python_gc_objects_collected_total Objects collected during gc
# TYPE python_gc_objects_collected_total counter
python_gc_objects_collected_total{generation="0"} 4920.0
python_gc_objects_collected_total{generation="1"} 491.0
python_gc_objects_collected_total{generation="2"} 0.0
# HELP python_gc_objects_uncollectable_total Uncollectable object found during GC
# TYPE python_gc_objects_uncollectable_total counter
python_gc_objects_uncollectable_total{generation="0"} 0.0
python_gc_objects_uncollectable_total{generation="1"} 0.0
python_gc_objects_uncollectable_total{generation="2"} 0.0
# HELP python_gc_collections_total Number of times this generation was collected
# TYPE python_gc_collections_total counter
python_gc_collections_total{generation="0"} 154.0
python_gc_collections_total{generation="1"} 14.0
python_gc_collections_total{generation="2"} 1.0
ArtyomKozyrev8 commented 9 months ago

@claws hi, may I try to implement this feature?