๐ŸŒ
Prometheus
prometheus.io โ€บ docs โ€บ prometheus โ€บ latest โ€บ querying โ€บ api
HTTP API | Prometheus
The data section of the query result ... one object in the list. At least one target has a value for HELP that do not match with the rest. curl -G http://localhost:9090/api......
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 74786014 โ€บ get-metrics-that-are-exposed-using-rest-apis-into-prometheus
python - Get metrics that are exposed using REST API's into Prometheus - Stack Overflow
For instance am trying to get the connected user count from this API ... If I want to grab the user_count and send it to data visualization platform like datadog or prometheus, is writing a custom exporter that polls at a certain interval and grabs the value, converts it to a metric(like gauge or counter) the only option to accomplish this?
Discussions

kubernetes - Parsing JSON rest api response in Prometheus - Stack Overflow
Currently I have a Kubernetes environment and using Py rometheus toolkit for monitoring. I have application counters which are not exposed in container metrics. However I am able to view them as a ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
How to get all the metrics of an instance with prometheus api? - Stack Overflow
I want to fetch the monitor host's metrics through the api of prometheus, and I need to initiate a request for each metric requested. curl http://IP:9090/api/v1/query?query=node_cpu_seconds_total{ More on stackoverflow.com
๐ŸŒ stackoverflow.com
kubernetes - Reading Prometheus metric using python - Stack Overflow
I am trying to read Prometheus metrics (the cpu and memory values) of a POD in kubernetes. I have Prometheus install and everything is up using local host 'http://localhost:9090/. I used the follow... More on stackoverflow.com
๐ŸŒ stackoverflow.com
python - how to write API query with filters in prometheus - Stack Overflow
Stack Data Licensing Get access to top-class technical expertise with trusted & attributed content. Stack Ads Connect your brand to the worldโ€™s most trusted technologist communities. Releases Keep up-to-date on features we add to Stack Overflow and Stack Internal. ... pythonjavascriptc#react... More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
Last9
last9.io โ€บ blog โ€บ prometheus-api
Prometheus HTTP API: Query and Manage Metrics (2026) | Last9
March 6, 2025 - In simple terms, the Prometheus API is how you talk to your Prometheus server. Think of it as the bouncer that guards the VIP section of metrics. It lets you query, analyze, and extract the data that Prometheus scrapes from your systems.
๐ŸŒ
SigNoz
signoz.io โ€บ guides โ€บ how to monitor rest apis with prometheus - a step-by-step guide
How to Monitor REST APIs with Prometheus - A Step-by-Step Guide | SigNoz
July 30, 2024 - This configuration tells Prometheus to scrape metrics from your API every 15 seconds. ... Integrate with your API: Modify your API code to expose a /metrics endpoint that Prometheus can scrape.
      ยป pip install prometheus-api-client
    
Published: Apr 13, 2026
Version: 0.7.2
๐ŸŒ
Better Stack
betterstack.com โ€บ community โ€บ questions โ€บ how-to-monitor-rest-apis-with-prometheus
How to Monitor REST APIs with Prometheus | Better Stack Community
If you're monitoring external APIs, use Prometheus exporters to fetch and expose data. Install Blackbox Exporter to monitor the availability and latency of REST APIs.
๐ŸŒ
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
Find elsewhere
๐ŸŒ
IOX Cloud
prometheus.rest
Prometheus REST API Reference | prometheus.rest
const queryMetrics = async () => { const params = new URLSearchParams({ query: 'rate(http_requests_total[5m])', time: new Date().toISOString() }); const response = await fetch( `http://localhost:9090/api/v1/query?${params}`, { headers: { 'Authorization': 'Basic ' + btoa('admin:password') } } ); const data = await response.json(); console.log(data.data.result); }; queryMetrics(); import requests from requests.auth import HTTPBasicAuth from datetime import datetime url = 'http://localhost:9090/api/v1/query' params = { 'query': 'up{job="prometheus"}', 'time': datetime.utcnow().isoformat() + 'Z' } response = requests.get( url, params=params, auth=HTTPBasicAuth('admin', 'password') ) data = response.json() for result in data['data']['result']: print(f"Metric: {result['metric']}, Value: {result['value'][1]}")
๐ŸŒ
Thomas Suedbroecker
suedbroecker.net โ€บ 2022 โ€บ 04 โ€บ 12 โ€บ access-prometheus-queries-using-the-prometheus-rest-api
Access Prometheus queries using the Prometheus HTTP API โ€“ Thomas Suedbroecker's Blog
April 12, 2022 - We used the Prometheus HTTP API to get the counter information from the Prometheus server. I also took a brief look at the Prometheus Go client library, that library mainly covers the topic: how to define a Prometheus client to provide a /metrics endpoint and data in the right format for Prometheus, so that Prometheus can gathering data.
Top answer
1 of 4
7

You can fetch all metrics with following curl expression:

url=http://{urIPorhostname}:9090    
curl -s  $url/api/v1/label/__name__/values | jq -r ".data[]" | sort 
2 of 4
2

All the metrics for a particular instance IP:9100 can be obtained via the following PromQL query:

{instance="IP:9100"}

This query returns all the metrics, which have the given instance="IP:9100" label. See time series selector docs for more details. See also PromQL tutorial.

The {instance="IP:9100"} query can be sent to the following Prometheus querying APIs:

  • /api/v1/query - this endpoint returns matching time series values at the given timestamp specified via time query arg. For example, curl 'http://prometheus:9090/api/v1/query?query={instance="IP:9100"}' . Make sure you properly encoded query arg with percent encoding. See this demo.
  • /api/v1/series - this endpoint returns matching time series without any data, e.g. only metric names and labels are returned. For example, curl 'http://prometheus:9090/api/v1/series?match[]={instance="IP:9100"}'. Make sure you properly encoded match[] arg with percent encoding. See this demo
  • /api/v1/query_range - this endpoint returns calculated datapoints for matching time series on the selected time range [start ... end] with the given step interval between samples. See more details about calculated datapoints in these docs.

If you want returning just unique metric names without labels, then you can query /api/v1/label/__name__/values endpoint: curl http://prometheus:9090/api/v1/label/__name__/values . The __name__ is a special label name used in Prometheus for referring to metric names. Note that multiple time series may share the same metric name. For example, http_requests_total{path="/foo"} and http_requests_total{path="/bar"} time series share http_requests_total metric name, while they differ by path label values.

๐ŸŒ
Medium
medium.com โ€บ javarevisited โ€บ monitoring-your-rest-api-with-prometheus-et-grafana-6b909a7b0c69
Monitoring your REST api with Prometheus et Grafana | by Erwan LE TUTOUR | Javarevisited | Medium
March 23, 2021 - If I follow the link i will see a list of values representing metrics from my application, like : ... Now that we expose our metrics to the /prometheus endpoint, we need to configure the prometheus server to collect them. We need to configure our prometheus to collect data from our endpoint, to do that we need to overwrite the prometheus.yml file.
๐ŸŒ
Nordic APIs
nordicapis.com โ€บ how-to-monitor-rest-apis-using-prometheus-and-grafana
How to Monitor REST APIs Using Prometheus and Grafana | Nordic APIs |
September 5, 2023 - Weโ€™ll be creating a container inside which we will use Python 3.8 Alpine image. Once the Docker image is imported, weโ€™ll install Flask and flask_prometheus_metrics. After that, itโ€™ll expose the API endpoints on port 5000. As of now, we only have told Docker to expose 5000 port. The CMD will execute the Flask app. ... from flask import Flask, request, jsonify from prometheus_client import make_wsgi_app from werkzeug.middleware.dispatcher import DispatcherMiddleware from werkzeug.serving import run_simple from flask_prometheus_metrics import register_metrics app = Flask(__name__) @app.route('/') def hello_world(): return 'This is my first API call!'
๐ŸŒ
Medium
ledinhcuong99.medium.com โ€บ prometheus-api-client-in-python-ec54291aa1a
Prometheus API Client in Python - Donald Le - Medium
January 19, 2021 - When it comes to metrics analyzing, Prometheus is a popular choice. For getting metrics from Prometheus we can use its HTTP API. Consider this http for getting query range in Prometheus: ... For convenience, we can install Python Prometheus API client library.
๐ŸŒ
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 containing GET parameters to be sent along with the API request, such as โ€œtimeโ€