From 262493780f1b31af8f2301ee59405a8627970f16 Mon Sep 17 00:00:00 2001 From: Solly Ross Date: Tue, 28 Aug 2018 13:45:55 -0400 Subject: [PATCH] Clarify multi-metric queries The example on the multi-metric query was a bit misleading, so this clarifies it a bit so it looks closer to a real-world example. --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 44dfa4849..662caa373 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,9 @@ the "discovery" and "naming" parts of the configuration. Then, you can write whichever metrics you want in the `metricsQuery`! The series query can contain whichever metrics you want, as long as they have the right set of labels. -For example, if you have two metrics `foo_total` and `foo_count`, you might write +For example, suppose you have two metrics `foo_total` and `foo_count`, +both with the label `system_name`, which represents the `node` resource. +Then, you might write ```yaml rules: @@ -139,7 +141,7 @@ rules: name: matches: 'foo_total' as: 'foo' - metricsQuery: 'sum(foo_total) by (<<.GroupBy>>) / sum(foo_count) by (<<.GroupBy>>)' + metricsQuery: 'sum(foo_total{<<.LabelMatchers>>}) by (<<.GroupBy>>) / sum(foo_count{<<.LabelMatchers>>}) by (<<.GroupBy>>)' ``` ### I get errors about SubjectAccessReviews/system:anonymous/TLS/Certificates/RequestHeader!