🌐
GitHub
github.com › prometheus › client_python
GitHub - prometheus/client_python: Prometheus instrumentation library for Python applications · GitHub
The official Python client for Prometheus. ... This package can be found on PyPI. Documentation is available on https://prometheus.github.io/client_python
Author: prometheus
🌐
PyPI
pypi.org › project › prometheus-client
prometheus-client · PyPI
The official Python client for Prometheus. ... This package can be found on PyPI. Documentation is available on https://prometheus.github.io/client_python
      » pip install prometheus-client
    
Published: Apr 09, 2026
Version: 0.25.0
🌐
Readthedocs
prometheus-api-client-python.readthedocs.io › en › latest › source › prometheus_api_client.html
prometheus_api_client package — Prometheus Client API Python 0.0.1 documentation
disable_ssl – (bool) If set to True, will disable ssl certificate verification for the http requests made to the prometheus host · retry – (Retry) Retry adapter to retry on HTTP errors · auth – (optional) Auth tuple to enable Basic/Digest/Custom HTTP Auth. See python requests library auth parameter for further explanation.
🌐
client_python
prometheus.github.io › client_python
client_python
This tutorial shows the quickest way to get started with the Prometheus Python library. ... from prometheus_client import start_http_server, Summary import random import time # Create a metric to track time spent and requests made. REQUEST_TIME = Summary('request_processing_seconds', 'Time spent processing request') # Decorate function with metric.
🌐
Read the Docs
app.readthedocs.org › projects › prometheus-api-client-python
Prometheus API client python - Read the Docs Community
Prometheus API client python · EN · artificial-intelligence prometheus prometheus-api prometheus-metrics · Maintainers · Repository 4n4nd/prometheus-api-client-python · Versions 3 Builds 46 ·
🌐
Generalist Programmer
generalistprogrammer.com › home › tutorials › python packages › prometheus client: cli library guide 2025
prometheus-client Python Guide [2026] | PyPI Tutorial
November 16, 2025 - Complete prometheus-client guide: python client for the prometheus monitoring system. Installation, usage examples, troubleshooting & best practices. Python 3.9++
Find elsewhere
🌐
PyPI
pypi.org › project › prometheus-api-client
prometheus-api-client · PyPI
To help better understand these metrics we have created a Python wrapper for the Prometheus http api for easier metrics processing and analysis. The prometheus-api-client library consists of multiple modules which assist in connecting to a Prometheus host, fetching the required metrics and performing various aggregation operations on the time series data.
      » pip install prometheus-api-client
    
Published: Apr 13, 2026
Version: 0.7.2
🌐
Prometheus
prometheus.io › docs › instrumenting › writing_clientlibs
Writing client libraries | Prometheus
For example, the CollectorRegistry.get_sample_value in Python. Ideally, a client library can be included in any application to add some instrumentation without breaking the application. Accordingly, caution is advised when adding dependencies to the client library. For example, if you add a library that uses a Prometheus ...
🌐
Better Stack
betterstack.com › community › guides › monitoring › prometheus-python-metrics
Python Monitoring with Prometheus (Beginner's Guide) | Better Stack Community
February 17, 2025 - This modification introduces the prometheus_client package and its generate_latest() function, which collects and returns metrics in a format that Prometheus can scrape. Once you've saved the file, visit http://localhost:8000/metrics in your browser or use curl to see the default Prometheus metrics: ... By default, Prometheus uses a global registry that automatically includes standard Python runtime and process-level metrics:
🌐
PyPI
pypi.org › project › prometheus-client › 0.14.0
Prometheus Python Client
The PROMETHEUS_MULTIPROC_DIR environment variable must be set to a directory that the client library can use for metrics. This directory must be wiped between process/Gunicorn runs (before startup is recommended). This environment variable should be set from a start-up shell script, and not directly from Python (otherwise it may not propagate to child processes).
      » pip install prometheus-client
    
Published: Apr 05, 2022
Version: 0.14.0
🌐
GitHub
github.com › valohai › prometheus-client-python
GitHub - valohai/prometheus-client-python: Prometheus instrumentation library for Python applications · GitHub
See the Pushgateway documentation for more information. instance_ip_grouping_key returns a grouping key with the instance label set to the host's IP address. If the push gateway you are connecting to is protected with HTTP Basic Auth, you can use a special handler to set the Authorization header. from prometheus_client import CollectorRegistry, Gauge, push_to_gateway from prometheus_client.exposition import basic_auth_handler def my_auth_handler(url, method, timeout, headers, data): username = 'foobar' password = 'secret123' return basic_auth_handler(url, method, timeout, headers, data, username, password) registry = CollectorRegistry() g = Gauge('job_last_success_unixtime', 'Last time a batch job successfully finished', registry=registry) g.set_to_current_time() push_to_gateway('localhost:9091', job='batchA', registry=registry, handler=my_auth_handler)
Author: valohai
🌐
Robust Perception
robustperception.io › instrumenting-python-with-prometheus
Instrumenting Python with Prometheus – Robust Perception | Prometheus Monitoring Experts
from prometheus_client import Summary, Counter HANDLERS = {'/foo': some_function, '/bar': other_function} REQUEST_DURATION = Summary('my_router_request_latency_seconds', 'Latency of request router handlers', ['path']) REQUEST_EXCEPTIONS = Counter('my_router_request_exceptions_total', 'Exceptions thrown in request router handlers', ['path']) def route_request(request): with REQUEST_DURATION.labels(request.path).time(): with REQUEST_EXCEPTIONS.labels(request.path).count_exceptions() HANDLERS[request.path](request)
🌐
PyPI
pypi.org › project › prometheus-client › 0.0.9
prometheus-client 0.0.9
JavaScript is disabled in your browser · Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
🌐
DEV Community
dev.to › leapcell › understanding-prometheus-and-monitoring-python-applications-3d0p
Understanding Prometheus and Monitoring Python Applications - DEV Community
May 28, 2025 - This article will delve into Prometheus data types, provide Python code examples to demonstrate their usage, analyze how they change over time (within one minute and five minutes), explain the underlying change principles, and finally present a Prometheus flowchart using English bash box diagrams.
🌐
GitHub
github.com › postmates › prometheus_client_python
GitHub - postmates/prometheus_client_python: Prometheus instrumentation library for Python applications · GitHub
See the Pushgateway documentation for more information. instance_ip_grouping_key returns a grouping key with the instance label set to the host's IP address. If the push gateway you are connecting to is protected with HTTP Basic Auth, you can use a special handler to set the Authorization header. from prometheus_client import CollectorRegistry, Gauge, push_to_gateway from prometheus_client.exposition import basic_auth_handler def my_auth_handler(url, method, timeout, headers, data): username = 'foobar' password = 'secret123' return basic_auth_handler(url, method, timeout, headers, data, username, password) registry = CollectorRegistry() g = Gauge('job_last_success_unixtime', 'Last time a batch job successfully finished', registry=registry) g.set_to_current_time() push_to_gateway('localhost:9091', job='batchA', registry=registry, handler=my_auth_handler)
Author: postmates
🌐
Gentoo
packages.gentoo.org › packages › dev-python › prometheus-client
dev-python/prometheus-client – Gentoo Packages
Python client for the Prometheus monitoring system · https://github.com/prometheus/client_python/