From f04b1b5559a80a4fd1745cf891ce392a056460c9 Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Thu, 25 Apr 2019 14:10:22 +0200 Subject: [PATCH] Clarify binary operator output label sets (#5512) * Clarify binary operator output label sets Signed-off-by: Julius Volz * Clarify binary op output labels further Signed-off-by: Julius Volz --- docs/querying/operators.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/querying/operators.md b/docs/querying/operators.md index fc8261f6d..7f92b3622 100644 --- a/docs/querying/operators.md +++ b/docs/querying/operators.md @@ -35,9 +35,10 @@ the original vector is multiplied by 2. **Between two instant vectors**, a binary arithmetic operator is applied to each entry in the left-hand side vector and its [matching element](#vector-matching) -in the right-hand vector. The result is propagated into the result vector and the metric -name is dropped. Entries for which no matching entry in the right-hand vector can be -found are not part of the result. +in the right-hand vector. The result is propagated into the result vector with the +grouping labels becoming the output label set. The metric name is dropped. Entries +for which no matching entry in the right-hand vector can be found are not part of +the result. ### Comparison binary operators @@ -69,10 +70,10 @@ modifier is provided, vector elements that would be dropped instead have the val applied to matching entries. Vector elements for which the expression is not true or which do not find a match on the other side of the expression get dropped from the result, while the others are propagated into a result vector -with their original (left-hand side) metric names and label values. +with the grouping labels becoming the output label set. If the `bool` modifier is provided, vector elements that would have been dropped instead have the value `0` and vector elements that would be kept have -the value `1` with the left-hand side label values. +the value `1`, with the grouping labels again becoming the output label set. ### Logical/set binary operators @@ -223,7 +224,7 @@ number of seen HTTP requests per application and group over all instances via: sum(http_requests_total) without (instance) Which is equivalent to: - + sum(http_requests_total) by (application, group) If we are just interested in the total of HTTP requests we have seen in **all**