🌐
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 ...
      » pip install prometheus-api-client
    
Published: Apr 13, 2026
Version: 0.7.2
🌐
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
For example, setting it to timedelta(hours=3) will download 3 hours worth of data in each request made to the prometheus host · store_locally – (bool) If set to True, will store data locally at, “./metrics/hostname/metric_date/name_time.json.bz2” · params – (dict) Optional dictionary ...
🌐
client_python
prometheus.github.io › client_python
client_python
... 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.
🌐
Readthedocs
prometheus-api-client-python.readthedocs.io › en › latest › _modules › prometheus_api_client › prometheus_connect.html
prometheus_api_client.prometheus_connect — Prometheus Client API Python 0.0.1 documentation
:param metric_name: (str) The name of the metric :param label_config: (dict) A dictionary that specifies metric labels and their values :param params: (dict) Optional dictionary containing GET parameters to be sent along with the API request, such as "time" :returns: (list) A list of current metric values for the specified metric :raises: (RequestException) Raises an exception in case of a connection error (PrometheusApiClientException) Raises in case of non 200 response status code Example Usage: ``prom = PrometheusConnect()`` ``my_label_config = {'cluster': 'my_cluster_id', 'label_2': 'label
🌐
GitHub
github.com › 4n4nd › prometheus-api-client-python
GitHub - 4n4nd/prometheus-api-client-python: A python wrapper for the prometheus http api · GitHub
Example: {“Authorization”: “bearer my_oauth_token_to_the_host”} disable_ssl – (bool) If set to True, will disable ssl certificate verification for the http requests made to the prometheus host · from prometheus_api_client import PrometheusConnect prom = PrometheusConnect(url ="<prometheus-host>", disable_ssl=True) # Get the list of all the metrics that the Prometheus host scrapes prom.all_metrics()
Starred by 274 users
Forked by 90 users
Languages: Python
🌐
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 ·
Find elsewhere
🌐
GitHub
github.com › AICoE › prometheus-api-client-python
AICoE/prometheus-api-client-python · GitHub
August 24, 2020 - A python wrapper for the prometheus http api. Contribute to AICoE/prometheus-api-client-python development by creating an account on GitHub.
Author: AICoE
🌐
DBI Services
dbi-services.com › accueil › instrument your python application with prometheus (part1)
Instrument your python application with Prometheus (Part1)
July 10, 2023 - Let’s start by installing the Prometheus client. To do this, we will execute the command pip install prometheus-client ... This command will allow us to install the library so that we can access it in our Python code.
🌐
Embrace
embrace.io › code samples
Metrics API Code Samples - Embrace.io
from datetime import datetime from prometheus_api_client import PrometheusConnect, MetricsList, Metric, MetricSnapshotDataFrame, MetricRangeDataFrame from prometheus_api_client.utils import parse_datetime # Constants # Embrace prometheus public URL metrics_api_endpoint = 'https://api.embrace.io/metrics' # API-Token token = '<your token>' # Embrace AppId app_id = '<your app id>' # Connect library to Embrace prometheus host prom = PrometheusConnect(url=metrics_api_endpoint, headers={'Authorization': 'Bearer ' + token}) # Get the list of all available metrics metrics = prom.all_metrics() print(me
🌐
Prometheus
prometheus.io › docs › instrumenting › clientlibs
Client libraries | Prometheus
Choose a Prometheus client library that matches the language in which your application is written. This lets you define and expose internal metrics via an HTTP endpoint on your application’s instance: Go · Java or Scala · Python · Ruby · Rust · Unofficial third-party client libraries: Bash ·
🌐
PyPI
pypi.org › project › prometheus-client
prometheus-client · PyPI
Documentation is available on https://prometheus.github.io/client_python
      » pip install prometheus-client
    
Published: Apr 09, 2026
Version: 0.25.0
🌐
Medium
medium.com › @simrankumari1344 › setting-up-prometheus-server-with-a-python-app-a-step-by-step-guide-fadba7d35dbe
Setting Up Prometheus Server with a Python App: A Step-by-Step Guide | by Simran Kumari | Medium
January 13, 2025 - 2. Write the Python App The Python app uses Flask for routing and the Prometheus client to track metrics. Key points: Starts an HTTP server on port 8000 to expose metrics at /metrics.
🌐
PyPI
pypi.org › project › promql-http-api
promql-http-api · PyPI
On the first line we create a PromqlHttpApi object named api. This example assumes that a Prometheus server is running on the local host, and it is listening to port 9090.
      » pip install promql-http-api
    
Published: Jul 17, 2024
Version: 0.3.4
🌐
Medium
medium.com › @letathenasleep › exposing-python-metrics-with-prometheus-c5c837c21e4d
Exposing Python Metrics with Prometheus | by Adso | Medium | Medium
July 6, 2023 - First, let’s create a Python API app using Flask. Create a new directory for your project and navigate to it. Then, create a file named app.py with the following code: from flask import Flask, jsonify, request from prometheus_client import ...