mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-02-14 17:49:59 +00:00
fix(slides.k8s.hpa-v2): update prometheus-adapter mapping rule
This commit is contained in:
committed by
Jérôme Petazzoni
parent
4f6b4b0306
commit
7af1a4cfbc
@@ -511,20 +511,18 @@ no custom metrics API (custom.metrics.k8s.io) registered
|
||||
Here is the rule that we need to add to the configuration:
|
||||
|
||||
```yaml
|
||||
- seriesQuery: |
|
||||
httplat_latency_seconds_sum{kubernetes_namespace!="",kubernetes_name!=""}
|
||||
- seriesQuery: 'httplat_latency_seconds_sum{namespace!="",service!=""}'
|
||||
resources:
|
||||
overrides:
|
||||
kubernetes_namespace:
|
||||
namespace:
|
||||
resource: namespace
|
||||
kubernetes_name:
|
||||
service:
|
||||
resource: service
|
||||
name:
|
||||
matches: "httplat_latency_seconds_sum"
|
||||
as: "httplat_latency_seconds"
|
||||
metricsQuery: |
|
||||
rate(httplat_latency_seconds_sum{<<.LabelMatchers>>}[2m])
|
||||
/rate(httplat_latency_seconds_count{<<.LabelMatchers>>}[2m])
|
||||
rate(httplat_latency_seconds_sum{<<.LabelMatchers>>}[2m])/rate(httplat_latency_seconds_count{<<.LabelMatchers>>}[2m])
|
||||
```
|
||||
|
||||
(I built it following the [walkthrough](https://github.com/DirectXMan12/k8s-prometheus-adapter/blob/master/docs/config-walkthrough.md
|
||||
|
||||
Reference in New Issue
Block a user