๐ŸŒ
Prometheus
prometheus.io โ€บ docs โ€บ prometheus โ€บ latest โ€บ querying โ€บ api
HTTP API | Prometheus
The data section of the query result consists of a list of objects that contain metric metadata and the target label set. The following example returns all metadata entries for the go_goroutines metric from the first two targets with label job="prometheus". curl -G http://localhost:9091/api/v1/targets/metadata \ --data-urlencode 'metric=go_goroutines' \ --data-urlencode 'match_target={job="prometheus"}' \ --data-urlencode 'limit=2'
๐ŸŒ
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.
Discussions

Using Prometheus to ingest from foreign APIs
Write your own exporter (there are Prometheus client libraries for various languages) that queries the API and exposes its data in the Prometheus format: https://prometheus.io/docs/instrumenting/clientlibs/ https://prometheus.io/docs/instrumenting/writing_exporters/ More on reddit.com
๐ŸŒ r/PrometheusMonitoring
4
7
February 3, 2020
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
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 ... 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.
๐ŸŒ
Microsoft Learn
learn.microsoft.com โ€บ en-us โ€บ azure โ€บ azure-monitor โ€บ metrics โ€บ prometheus-api-promql
Query Prometheus Metrics using the API and PromQL - Azure Monitor | Microsoft Learn
Azure Monitor managed service for Prometheus collects metrics from Azure Kubernetes clusters and stores them in an Azure Monitor workspace. Prometheus Query Language (PromQL) is a functional query language that you can use to query and aggregate time-series data. Use PromQL to query and aggregate metrics stored in an Azure Monitor workspace. This article describes how to query an Azure Monitor workspace by using PromQL via the REST API.
๐ŸŒ
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.
๐ŸŒ
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 - Prometheus gets the counter values over the /metrics endpoint and we will use the Prometheus HTTP API /api/v1/query?query=goobers_total to extract the goobers_total counter values from Prometheus.
๐ŸŒ
Postman
postman.com โ€บ oracledevs โ€บ verrazzano-1-x-apis โ€บ documentation โ€บ wdd55hg โ€บ prometheus-http-api
Prometheus HTTP API | Documentation | Postman API Network
// There will still be data in the data field. "warnings": ["<string>"] } <rfc3339 | unix_timestamp>: Input timestamps may be provided either in RFC3339 format or as a Unix timestamp in seconds, with optional decimal places for sub-second precision. Output timestamps are always represented as Unix timestamps in seconds. <series_selector>: Prometheus time series selectors like http_requests_total or http_requests_total{method=~"(GET|POST)"} and need to be URL-encoded.
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]}")
๐ŸŒ
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 - Learn how to effectively monitor REST APIs using Prometheus. This comprehensive guide covers setup, instrumentation, health checks, and advanced techniques.
๐ŸŒ
Red Hat
access.redhat.com โ€บ solutions โ€บ 3775611
How to get the metrics using REST API of Prometheus in RHOCP? - Red Hat Customer Portal
May 15, 2025 - How to get a specific metric from Prometheus using REST API ? How to get the metrics using curl from Prometheus ?
๐ŸŒ
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 - In this tutorial, Prometheus will act as a data source where all the data will be available on port 9090, and Grafana will fetch these data points and display them in the dashboard.
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.

๐ŸŒ
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 ...
๐ŸŒ
GitHub
github.com โ€บ mklabs โ€บ prometheo
GitHub - mklabs/prometheo: Prometheus REST API client for node and the browser ยท GitHub
GET /api/v1/query URL query parameters: query=<string>: Prometheus expression query string. time=<rfc3339 | unix_timestamp>: Evaluation timestamp. Optional. The current server time is used if the time parameter is omitted. The data section of the query result has the following format:
Author: mklabs
๐ŸŒ
IBM
ibm.com โ€บ docs โ€บ en โ€บ SSFL82_1.1.5 โ€บ com.ibm.icabi_kc.doc โ€บ user โ€บ dd_scenario_rest_api_prometheus_dashboard.html
Scenario: Creating a Prometheus REST API Dashboard
You can use the Prometheus REST API Connector that is already provided in Cloud Application Business Insights to connect to a Prometheus System. You can then create a manual data definition to retrieve data from the system and display it on a dashboard.
๐ŸŒ
Prometheus
prometheus.io โ€บ docs โ€บ prometheus โ€บ latest โ€บ querying โ€บ remote_read_api
Remote Read API | Prometheus
This API provides data read functionality from Prometheus. This interface expects snappy compression. The API definition is located here .
๐ŸŒ
Google Groups
groups.google.com โ€บ g โ€บ prometheus-developers โ€บ c โ€บ vAiOnEmbTlg
Getting data out from Prometheus
๎—“As an intermediary solution, I created a file called all-prometheus-metrics.txt containing one metric per line: cadvisor_version_info container_cpu_system_seconds_total ... scrape_samples_scraped up And retrieved the values for each metric for the last 14 days using this bash script that queries the REST API: for metric in $(cat all-prometheus-metrics.txt); do curl "localhost:9090/api/v1/query?query=$metric[14d]" | gzip > $metric.gz; done The interval syntax is query=scrape_samples_scraped[14d] and url encoded to [14d]. The pipe through gzip reduces storage requirements on the fly.