The endpoint for that is http://localhost:9090/api/v1/label/__name__/values

API Reference

Answer from vinodkottem on Stack Overflow
🌐
SigNoz
signoz.io › guides › how to retrieve all prometheus metrics - a step-by-step guide
How to Retrieve All Prometheus Metrics - A Step-by-Step Guide | SigNoz
October 30, 2024 - Integration APIs: Enabling visualization tools like Grafana to query and display the metrics. To retrieve all the metrics from a Prometheus instance, you can make use of the Prometheus HTTP API.
Discussions

Prometheus get list of all metrics and descriptions - Stack Overflow
It would be good if this UI Prometheus ... in the getting started page for prometheus for the time-starved developer who ignored the UI drop-downs and focused only on the promql text entry 2023-08-08T10:54:01.71Z+00:00 ... Prometheus provides /api/v1/targets/metadata endpoint, which returns the list of metric names with ... More on stackoverflow.com
🌐 stackoverflow.com
Prometheus metrics and API Star

Pretty simple integration, but the Prometheus client for python really needs to be used in multi-process mode with most production scale web applications, since (in my experience) you aren't going to get decent performance without spreading you queries across multiple instances.

More on reddit.com
🌐 r/Python
3
4
November 26, 2017
python , how to import prometheus endpoint metrics for processing by another system
Hopefully someone has already done this as I can't much in the way of examples or information. I just want to validate I am on the right track and… More on reddit.com
🌐 r/PrometheusMonitoring
1
0
September 12, 2020
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
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.

🌐
Prometheus
prometheus.io › docs › prometheus › latest › querying › api
HTTP API | Prometheus
The server also exposes two Prometheus metrics: prometheus_engine_query_samples_total (samples loaded) and prometheus_engine_query_samples_read_total (samples read). See Per-step stats for the promql-per-step-stats feature flag. The following endpoint formats a PromQL expression in a prettified way: GET /api/v1/format_query POST /api/v1/format_query
🌐
Last9
last9.io › blog › prometheus-api
Prometheus HTTP API: Query and Manage Metrics (2026) | Last9
March 6, 2025 - The final query returns metadata about all metrics, including their type (counter, gauge, histogram) and help text. This metadata exploration is invaluable when you’re new to a system or trying to find the right metrics for a specific monitoring need. The Prometheus API isn’t meant to live in isolation – its real value comes from connecting it with your other tools.
🌐
Promlabs
promlabs.com › blog › 2020 › 12 › 17 › promql-queries-for-exploring-your-metrics
PromLabs | Blog - PromQL Queries for Exploring Your Metrics
December 17, 2020 - Let's say you wanted to list all possible values for the mode label on the metric name demo_cpu_usage_seconds_total. Then you could query for: ... Note: In this latter case, you may again use the label values API endpoint (but this time for the mode label) instead of a PromQL query. As a Prometheus server administrator, the total number of time series that a server needs to keep track of is one of the main memory and scaling bottlenecks to watch out for. To get a feeling where "all those series" are coming from, you can write PromQL queries to count how many series there are for a given job, instance (target), metric name, or other type of dimensional grouping.
🌐
GitHub
gist.github.com › zulhfreelancer › da4767404a88fb2273e9259b8d96d8f8
Get all Prometheus metrics and descriptions/help texts · GitHub
get-all-prometheus-metrics.md · Requirement: promtool · curl -sg 'http://prom-server:prom-port/api/v1/metadata' | jq -r '.data' curl -sg 'http://prom-server:prom-port/api/v1/metadata' | jq -r '(["metric_name","description"], (.data | to_entries[] | [.key, .value[0].help])) | @csv' Sign up for free to join this conversation on GitHub.
Find elsewhere
🌐
Better Stack
betterstack.com › community › questions › prometheus-endpoint-of-all-available-metrics
Prometheus Endpoint of All Available Metrics | Better Stack Community
November 18, 2024 - In Prometheus, you can access the endpoint that lists all available metrics by querying the /metrics endpoint of your Prometheus server.
🌐
Grafana
grafana.com › docs › grafana-cloud › cost-management-and-billing › analyze-costs › metrics-costs › prometheus-metrics-costs › usage-analysis-api
Analyze metrics usage with the Prometheus API | Grafana Cloud documentation
To learn more about the Prometheus HTTP API, see the Prometheus API docs. ... This method may report some inactive metrics. To use the metadata API to quickly fetch a list of all metrics, perform the following HTTP request using curl:
🌐
npm
npmjs.com › package › prometheus-api-metrics
prometheus-api-metrics - npm
const axios = require('axios'); const axiosTime = require('axios-time'); axiosTime(axios); try { const response = await axios({ baseURL: 'http://www.google.com', method: 'get', url: '/' }); Collector.collect(response); } catch (error) { Collector.collect(error); } ... In order to collect metrics from axios client the axios-time package is required. This package supports koa server that uses koa-router and koa-bodyparser · const { koaMiddleware } = require('prometheus-api-metrics') app.use(koaMiddleware())
      » npm install prometheus-api-metrics
    
Published: Mar 09, 2025
Version: 4.0.0
🌐
DEV Community
dev.to › 0012303 › prometheus-has-a-free-api-heres-how-to-use-it-for-metrics-automation-446m
Prometheus Has a Free API: Here's How to Use It for Metrics Automation - DEV Community
March 28, 2026 - import requests from datetime import datetime, timedelta PROM_URL = "http://localhost:9090" def query_instant(promql): resp = requests.get(f"{PROM_URL}/api/v1/query", params={"query": promql}) return resp.json()["data"]["result"] def query_range(promql, hours=1, step="15s"): end = datetime.now() start = end - timedelta(hours=hours) resp = requests.get(f"{PROM_URL}/api/v1/query_range", params={ "query": promql, "start": start.timestamp(), "end": end.timestamp(), "step": step }) return resp.json()["data"]["result"] # Get all up/down targets targets = query_instant("up") for t in targets: status = "UP" if t["value"][1] == "1" else "DOWN" print(f"{t['metric']['job']:20s} {t['metric']['instance']:30s} {status}")
🌐
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
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.
🌐
GitHub
github.com › PayU › prometheus-api-metrics
GitHub - PayU/prometheus-api-metrics: API and process monitoring with Prometheus for Node.js micro-service · GitHub
const axios = require('axios'); const axiosTime = require('axios-time'); axiosTime(axios); try { const response = await axios({ baseURL: 'http://www.google.com', method: 'get', url: '/' }); Collector.collect(response); } catch (error) { Collector.collect(error); } ... In order to collect metrics from axios client the axios-time package is required. This package supports koa server that uses koa-router and koa-bodyparser · const { koaMiddleware } = require('prometheus-api-metrics') app.use(koaMiddleware())
Author: PayU
🌐
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 ?
🌐
Medium
eytanmanor.medium.com › an-introduction-to-prometheus-a-tool-for-collecting-metrics-and-monitoring-services-12fcc3bdb5d6
An introduction to Prometheus — a tool for collecting metrics and monitoring services | by Eytan Manor | Medium
January 2, 2023 - If the Prometheus server is running on a Kubernetes cluster, it would usually pull this information from the Kubernetes API. Scraping — For each service in the list, send an HTTP GET /metrics request and store the metrics for later querying.
🌐
Google Groups
groups.google.com › g › prometheus-users › c › -3zL82taz7M
Get all metric names per HTTP API
October 25, 2017 - If you look here: https://prometheus.io/docs/prometheus/latest/querying/api/#expression-queries specifically just below the first code block, you can see the parameters the query API will take.
🌐
Google Groups
groups.google.com › g › prometheus-developers › c › yiSp98k1UM4
How to get all metric names from Prometheus server filtered by a particular label
We want to get all metric names from Prometheus server filtered by a particular label. Step 1 : Used following query to get all metric names, query succeeded with all metric names.curl -g 'http://localhost:9090/api/v1/label/__name__/values
🌐
New Relic
docs.newrelic.com › docs › infrastructure › prometheus-integrations › view-query-data › view-query-your-prometheus-data
View and query your Prometheus data | New Relic Documentation
To query and visualize the metrics collected for your Prometheus OpenMetrics or remote write integration with New Relic, you can use NRQL. You can also translate your PromQL-style queries to NRQL using either Grafana or the query builder. All metrics for Docker and Kubernetes are stored in ...
🌐
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.