Prometheus Client
Python client for the Prometheus monitoring system, currently at version 0.24.1. It is actively maintained with frequent updates for enhancements and bug fixes.
Warnings
- breaking Breaking changes in HTTP method validation introduced in v0.21.0.
- gotcha Incorrect usage of CollectorRegistry may lead to metrics not appearing.
Install
-
pip install prometheus-client
Imports
- CollectorRegistry
from prometheus_client import CollectorRegistry
Quickstart
from prometheus_client import start_http_server, CollectorRegistry
import time
registry = CollectorRegistry()
start_http_server(8000)
while True:
time.sleep(1)