🌐
Robust Perception
robustperception.io › using-group_left-to-calculate-label-proportions
Using group_left to calculate label proportions – Robust Perception | Prometheus Monitoring Experts
The group_left modifier of Prometheus is the key. We previously looked at group_left in the context of machine roles. Here the use case is different as there's only one metric with one set of labels involved. We'll take the example of machine CPU, and unlike the last time we won't take advantage of the fact that it happens to sum to 1.0.
🌐
Prometheus
prometheus.io › docs › prometheus › latest › querying › operators
Operators | Prometheus
If a fill modifier is used on the "one" side of a match and the grouping modifier specifies label names to include from the "one" side (e.g. left_vector * on(instance, job) group_left(info_label) fill_right(1) right_vector), those labels will not be filled in for missing series, as there is no source for their values. Fill modifiers are not supported for set operators (and, or, unless), as the purpose of those operators is to filter series based on presence or absence in the other vector. Example query, filling in missing series on the either side with 0:
Discussions

monitoring - How can I 'join' two metrics in a Prometheus query? - Stack Overflow
consul_service_tags is always 1, ... group_left(env) consul_service_tags 2019-08-21T12:05:18.143Z+00:00 ... Good PromQL primer if this is as impenetrable to you as it was to me a few hours ago :joy: 2020-01-18T05:18:00.287Z+00:00 ... Save this answer. ... Show activity on this post. It is a good practice in Prometheus ecosystem to expose additional labels, which can be joined to multiple metrics, via a separate info-like metric as explained in this article. For example, ... More on stackoverflow.com
🌐 stackoverflow.com
promql - join prometheus queries while keeping data from the left side - Stack Overflow
I want to build promql query that joins two vectors: one with some metrics and other is informational. The caveat is that info vector doesn't have all the information for "joining label",... More on stackoverflow.com
🌐 stackoverflow.com
Doing group_left() multiplication (left cardinality > right side) while also wanting to add a 1:1 matching label from the right side
I'd like to compose a query to 'add' nodename label (as provided by node_uname_info metric from node_exporter) by matching it against instance - this is easy to do when there's no e... More on github.com
🌐 github.com
13
March 24, 2016
group_left isn't working with multiply exporters
Hi @brian-brazil , I saw few issues about group_* with a good your comments. Can you take a look on this one, please ? May be you will have some suggestions. Bug Report I'm trying to add nodena... More on github.com
🌐 github.com
3
December 11, 2019
🌐
Webscale
webscale.com › home › blog › prometheus querying – breaking down promql
PromQL Querying: group_left, Joins, and Working Examples
June 8, 2026 - varnish_main_client_req{namespace="section-9469f9cc28d8d"} * on (pod) group_left(node) kube_pod_info ... We can then take this over to Grafana to make a dashboard and chart, add this data to a graph panel, and clearly view it all.
🌐
Chris's Wiki
utcc.utoronto.ca › ~cks › space › blog › sysadmin › PrometheusGroupLeftAndRightNotes
Prometheus's group_left() and group_right() operators
December 17, 2023 - The value comes from the left side metric, but by default all the labels will come from the right side metric and you'll have to explicitly pull in all of the left side labels you may care about for generating alert messages. (If you're using group_*() in order to pull in extra labels from the right hand side of a one to one match, this is why you want to use group_left() instead of group_right(); it automatically preserves all of the labels of your left side metric.)
🌐
OneUptime
oneuptime.com › home › blog › how to join two metrics in prometheus query
How to Join Two Metrics in Prometheus Query
December 17, 2025 - # Add owner label from namespace to pod metrics container_memory_usage_bytes * on(namespace) group_left(label_owner) kube_namespace_labels # Result has both pod labels AND label_owner
🌐
Iximiuz
iximiuz.com › en › posts › prometheus-vector-matching
Prometheus Cheat Sheet - How to Join Multiple Metrics (Vector Matching)
November 30, 2021 - For example, when I needed to match multiple metrics using the common labels, I quickly found myself reading the code implementing binary operations on vectors. Without a solid understanding of the matching rules, I constantly stumbled upon various query execution errors, such as complaints about missing group_left or group_right modifier. Reading the code, feeding my local Prometheus ...
🌐
Grafana
grafana.com › blog › promql-vector-matching-what-it-is-and-how-it-affects-your-prometheus-queries
PromQL vector matching: what it is and how it affects your Prometheus queries | Grafana Labs
December 14, 2024 - When we want to preserve labels from the left side, we use group_left, and when from the right side, we use group_right: Now, we have all our Pokémon type percentages. To check, the water type percentage is 5.26%, just as we calculated before.
Top answer
1 of 3
76

You can use the argument list of group_left to include extra labels from the right operand (parentheses and indents for clarity):

(
  max(consul_health_service_status{status="critical"}) 
  by (service_name,status,node) == 1
)
   + on(service_name,node) group_left(env)
(
   0 * consul_service_tags
)

The important part here is the operation + on(service_name,node) group_left(env):

  • the + is "abused" as a join operator (fine since 0 * consul_service_tags always has the value 0)
  • group_left(env) is the modifier that includes the extra label env from the right (consul_service_tags)
2 of 3
15

It is a good practice in Prometheus ecosystem to expose additional labels, which can be joined to multiple metrics, via a separate info-like metric as explained in this article. For example, consul_service_tags metric exposes a set of tags, which can be joined to metrics via (service_name, node) labels.

The join is usually performed via on() and group_left() modifiers applied to * operation. The * doesn't modify values for time series on the left side because info-like metrics usually have constant 1 values. The on() modifier is used for limiting the labels used for finding matching time series on the left and the right side of *. The group_left() modifier is used for adding additional labels from time series on the right side of *. See these docs for details.

For example, the following PromQL query adds env label from consul_service_tags metric to consul_health_service_status metric with the same set of (service_name, node) labels:

consul_health_service_status
  * on(service_name, node) group_left(env)
consul_service_tags

Additional label filters can be added to consul_health_service_status if needed. For example, the following query returns only time series with status="critical" label:

consul_health_service_status{status="critical"}
  * on(service_name, node) group_left(env)
consul_service_tags
Find elsewhere
🌐
Last9
last9.io › blog › prometheus-group-by-label
Prometheus Group By Label: Advanced Aggregation Techniques for Monitoring | Last9
June 12, 2026 - For example, your core metrics may not include team ownership, version tags, or deployment info, but you have that context available in a separate metric. This is where group_left and group_right help you. ... This metric shows requests, but it doesn’t include useful context like the owning team or the deployed version. ... To combine these two, you need a Prometheus vector matching operation.
🌐
Coralogix
coralogix.com › home › promql tutorial: 5 tricks to become a prometheus god
PromQL Tutorial: 5 Tricks to Become a Prometheus God
June 3, 2025 - We can change the way vectors a and b are matched using labels. For instance, the query a * on (foo, bar) group_left(baz) b matches vectors a and b on metric labels foo and bar.
🌐
Yannick Pereira-Reis
ypereirareis.github.io › blog › 2020 › 02 › 21 › how-to-join-prometheus-metrics-by-label-with-promql
How to join Prometheus metrics by label with PromQL – Yannick Pereira-Reis
How to query prometheus to have sum of “disk bytes read” by instance/node/server name ? The result we want is something like that : node2 => 22082332072448 node4 => 8439202548224 node5 => 28203612148224 node6 => 56887513977344 node3 => 30887053824 node1 => 36352176166912 · sum(node_disk_bytes_read * on(instance) group_left(node_name) node_meta{}) by (node_name)
🌐
GitHub
github.com › prometheus › prometheus › issues › 6451
group_left isn't working with multiply exporters · Issue #6451 · prometheus/prometheus
December 11, 2019 - (up{service="node-metrics-proxy"}) + on(instance) group_left(nodename) (0 * node_uname_info) and it's working properly and I always get nodename for up key. But when I want to get the label from different exporter it says: no data :( As example:
Author: prometheus
🌐
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 - Practice and experimentation are ... in Prometheus · PromQL doesn't have explicit inner and outer join operations. Instead, it uses vector matching with modifiers like group_left and group_right to achieve similar results. The default behavior is similar to an inner join, where only matching elements are included in the result. Yes, you can join multiple metrics by chaining operations. For example...
🌐
Google Groups
groups.google.com › g › prometheus-users › c › KmPqvJuFoHY
turning a group_left use of info-block into a range vector
device_boot_time * on (instance) group_left(region, firmware) device_info{region="California", firmware="v1.0"} Even through seems to return an instant value - I have not been able to figure out if it is possible to turn into a range vector · Any attempt to put '[5m]' anywhere in this vector matching query results in an error. For example if at the end, the error is: