example-prometheus-nodejs
example-prometheus-nodejs copied to clipboard
yaml: line 7: mapping values are not allowed in this context
➜ prometheus-data git:(master) ✗ promtool test rules alert.rules Unit Testing: alert.rules FAILED: yaml: line 7: mapping values are not allowed in this context
How to fix this issue.
you can update new config of alert.rules
like below:
groups:
- name: PM2 Alert
rules:
- alert: APIHighMedianResponseTime
expr: histogram_quantile(0.5, sum(rate(http_request_duration_ms_bucket[1m])) by (le, service, route, method)) > 100
for: 60s
annotations:
summary: "High median response time on {{ $labels.service }} and {{ $labels.method }} {{ $labels.route }}"
description: "{{ $labels.service }}, {{ $labels.method }} {{ $labels.route }} has a median response time above 100ms (current value: {{ $value }}ms)"
Created a PR #8 containing @ducmanh86 alert.rules
example. Verified with prom/prometheus v2.1.0.
In addition, I have created PR #9 and have added my thoughts in that PR about potentially branching the Repo.