I found here this solution: {__name__=~"metricA|metricB|metricC",container_name=~"frontend|backend|db"}.

Answer from roie on Stack Overflow
🌐
Prometheus
prometheus.io › docs › prometheus › latest › querying › api
HTTP API | Prometheus
The data section of the query result consists of an object where each key is a metric name and each value is a list of unique metadata objects, as exposed for that metric name across all targets. The following example returns two metrics. Note that the metric http_requests_total has more than 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/v1/metadata?limit=2
🌐
Last9
last9.io › blog › query-multiple-metrics-in-prometheus
Easily Query Multiple Metrics in Prometheus | Last9
February 21, 2026 - For help setting up metrics collection, check out our guide to getting started with Prometheus metrics endpoints. Ready to level up? These advanced techniques will help you get even more from your Prometheus queries: Control how time series are matched using modifiers: http_requests_total{job="api"} / ignoring(method) http_requests_total{job="api"}
Discussions

How to execute multiple queries in one call in Prometheus - Stack Overflow
You can use the or operator, however this does not generalise as it ignores metric names. I'd suggest making multiple queries to the API. ... Thanks, easiest and most elegant solution for quickly debugging a query in Prometheus' query tool. More on stackoverflow.com
🌐 stackoverflow.com
grafana - Query multiple metrics in one Prometheus HTTP Call - Stack Overflow
I have the following query which works, it requests the results of multiple prometheus metrics in one call for last 30 seconds. I`m just not sure how to extend this query to also calculate the rate for all these metrics. Can anyone help? /api/v1/query?query={__name__=~"metric1|metric2|metr... More on stackoverflow.com
🌐 stackoverflow.com
How to get all the metrics of an instance with prometheus api? - Stack Overflow
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 ... More on stackoverflow.com
🌐 stackoverflow.com
promql - query Prometheus HTTP API by list of metrics - Stack Overflow
I want to query prometheus with a list of metric names in a single curl request. There is a way to do it? Something like this - curl 'localhost:9090/api/v1/labels?name= '... More on stackoverflow.com
🌐 stackoverflow.com
🌐
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 - Yes, you can either use Prometheus federation to aggregate metrics across instances or implement tools like Thanos, which allows you to query multiple Prometheus instances seamlessly.
🌐
Google Groups
groups.google.com › g › prometheus-developers › c › exc5RKBLpOg
Prometheus Query Rest API for Multiple metrics
Is it possible to query "multiple metric with some kind of aggregate" from Prometheus? Let say i want to do single api request to get both rate(http_requests_total[5m]), rate(memory_free[5m]) Will it be possible ? No, you need to make two requests. It also doesn't make sense to take a rate ...
🌐
Prometheus
prometheus.io › docs › prometheus › latest › querying › examples
Query examples | Prometheus
Return all time series with the metric http_requests_total and the given job and handler labels: http_requests_total{job="apiserver", handler="/api/comments"} Return a whole range of time (in this case 5 minutes up to the query time) for the same vector, making it a range vector: http_requests_total{job="apiserver", handler="/api/comments"}[5m] Note that an expression resulting in a range vector cannot be graphed directly, but viewed in the tabular ("Console") view of the expression browser.
🌐
Google Groups
groups.google.com › g › prometheus-users › c › 59VKF1kHmhU
How to query Multiple Metric with PromQL
I tried, but the operator "or" will return just one value with "or" of multiple values from multiple queries. Vào 16:50:16 UTC+7 Thứ Tư, ngày 11 tháng 9 năm 2019, tgug...@redhat.com đã viết: Have you tried using the "or" operator to combine these two queries? On Wed, 2019-09-11 at 02:36 -0700, Mạnh Nguyễn Tiến wrote: ... > http://Prometheus_IP_Address/api/v1/query?query={__name__=~”node_memory_Buffers_bytes|node_cpu_seconds_total”,instance=”Node_Exporter_IPAddress”}
Find elsewhere
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.

🌐
Google Groups
groups.google.com › g › prometheus-users › c › PMYdrC5solU
HTTP API request for querying multiple metrics
March 23, 2023 - It is possible to make PromQL queries which use calculations based on multiple metrics. There is "and", "or" and other operators. If you want to get the raw data via the API instead, you might have better luck by using the federate endpoint: https://prometheus.io/docs/prometheus/latest/federation/ ...
🌐
Stack Overflow
stackoverflow.com › questions › 77389374 › query-prometheus-http-api-by-list-of-metrics
promql - query Prometheus HTTP API by list of metrics - Stack Overflow
If you need list grouped by metric, you might use endpoint api/v1/series. It returns the list of time series matching selector (basically all the possible labels for every selected metric).
🌐
Google Cloud
cloud.google.com › google cloud observability › query using the prometheus api or ui
Query using the Prometheus API or UI | Google Cloud Observability | Google Cloud Documentation
As a Google Cloud API, the API uses OAuth2 authentication, and as part of the Cloud Monitoring API, the value of the PROJECT_ID is the scoping project of a metrics scope, so you can retrieve data from any project in the metrics scope. For more information about scoping, see Metrics scopes. To use this endpoint, provide a PromQL expression. For example, the following instant query retrieves all time series that have the metric name up: curl https://monitoring.googleapis.com/v1/projects/PROJECT_ID/location/global/prometheus/api/v1/query \ -d "query=up" \ -H "Authorization: Bearer $(gcloud auth print-access-token)"
🌐
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.
🌐
Prometheus
prometheus.io › docs › prometheus › latest › querying › basics
Querying basics | Prometheus
This is especially relevant for Prometheus's query language, where a bare metric name selector like api_http_requests_total could expand to thousands of time series with different labels. Also, keep in mind that expressions that aggregate over many time series will generate load on the server even if the output is only a small number of time series.
🌐
Reddit
reddit.com › r/prometheusmonitoring › bulk prometheus api poll
r/PrometheusMonitoring on Reddit: Bulk Prometheus API Poll
March 9, 2023 -

Hello!

I've got a unique situation that I'm looking to the community to see if anyone has done something similar.

Basically I've got a Prometheus/Grafana instance running scraping metrics. I've configured a lot of dashboards in Grafana via PromQL queries and it is working great.

I have another system where I'd like to import all of these metrics on an interval to combine with some other infrastructure items I have there. The best two paths I could come up with are:

  • Submit a GET request to the Prometheus API for each PromQL query I've defined and store those as key:value pairs (there are about 100 PromQL queries I'm looking to store on a fixed interval - let's say every 5 mins)

    • This gets the job done but isn't very efficient as I would be submitting 100 GET requests via a loop every 5 mins

  • Submit a single bulk GET request gathering all the metrics and somehow re-create the PromQL queries programmatically (sums, rates, etc) by manipulating the json response

    • This would be more efficient and less load on Prometheus itself, but that a lot of work sifting through that much json

Has anyone attempted to do the same or have any ideas that I might be missing? I'm pretty much limited to getting the metrics through the Prometheus API.

🌐
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 ...
🌐
SigNoz
signoz.io › guides › how can i 'join' two metrics in a prometheus query? - joining metrics in promql
How can I 'join' two metrics in a Prometheus query? - Joining Metrics in PromQL | SigNoz
July 24, 2024 - Instead, it uses vector matching ... join, where only matching elements are included in the result. Yes, you can join multiple metrics by chaining operations....
🌐
OneUptime
oneuptime.com › home › blog › how to join two metrics in prometheus query
How to Join Two Metrics in Prometheus Query
December 17, 2025 - For arithmetic and comparison operators, Prometheus supports one-to-one, many-to-one, and one-to-many matches: flowchart TB subgraph "One-to-One" A1[Metric A: instance=web-1] --- B1[Metric B: instance=web-1] end subgraph "Many-to-One" A2[Metric A: pod=app-1] --- B2[Metric B: namespace=prod] A3[Metric A: pod=app-2] --- B2 A4[Metric A: pod=app-3] --- B2 end subgraph "Many-to-Many (not allowed for arithmetic joins)" A5[Metric A: method=GET] --- B3[Metric B: endpoint=/api] A5 --- B4[Metric B: endpoint=/web] A6[Metric A: method=POST] --- B3 A6 --- B4 end