example-prometheus-nodejs icon indicating copy to clipboard operation
example-prometheus-nodejs copied to clipboard

yaml: line 7: mapping values are not allowed in this context

Open spursy opened this issue 5 years ago • 2 comments

➜ 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.

spursy avatar Jul 08 '19 05:07 spursy

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)"

ducmanh86 avatar Jul 11 '19 16:07 ducmanh86

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.

haysclark avatar Apr 22 '20 21:04 haysclark