gc-prometheus

Exports garbage collection metrics for Prometheus.io.


Keywords
python, gc, monitoring, prometheus
License
Apache-2.0
Install
pip install gc-prometheus==0.1.0

Documentation

python-gc-prometheus

Export metrics about the Python garbage collector for Prometheus.io.

PyPI version Build Status

Installation

pip install gc_prometheus

Usage

Simply import gc_prometheus to register the metrics.

See the prometheus_client documentation to see how to export the metrics via an HTTP server. If you're using Django, check out django-prometheus which can export metrics to a Django view, and exports metrics relevant to Django.

To aggregate the exported variables, see the Prometheus.io documentation.

Advanced usage

This package contains two series of metrics:

  • gc stats, which simply export counters exposed by the gc module. This is mostly counters of objects. You can import these metrics alone by importing gc_prometheus.stats.
  • gc profiling stats, which register callbacks with the gc module and add some negligible overhead to the garbage collection process. This is mostly counters of time spent in the GC process. You can import these metrics alone by importing gc_prometheus.profile.

Importing gc_prometheus imports both sets of metrics.