mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-05 17:27:51 +00:00
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:
parent
b755cf7f93
commit
262493780f
1 changed files with 4 additions and 2 deletions
|
|
@ -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 in the `metricsQuery`! The series query can contain
|
||||||
whichever metrics you want, as long as they have the right set of labels.
|
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
|
```yaml
|
||||||
rules:
|
rules:
|
||||||
|
|
@ -139,7 +141,7 @@ rules:
|
||||||
name:
|
name:
|
||||||
matches: 'foo_total'
|
matches: 'foo_total'
|
||||||
as: 'foo'
|
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!
|
### I get errors about SubjectAccessReviews/system:anonymous/TLS/Certificates/RequestHeader!
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue