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.
This commit is contained in:
Solly Ross 2018-08-28 13:45:55 -04:00
parent b755cf7f93
commit 262493780f

View file

@ -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!