Skip to content

Commit

Permalink
Clarify multi-metric queries
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DirectXMan12 committed Aug 28, 2018
1 parent b755cf7 commit 2624937
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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!
Expand Down

0 comments on commit 2624937

Please sign in to comment.