Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
spursy opened this issue Jul 8, 2019 · 2 comments
Open

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

spursy opened this issue Jul 8, 2019 · 2 comments

Comments

@spursy
Copy link

spursy commented Jul 8, 2019

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

@ducmanh86
Copy link

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

haysclark added a commit to haysclark/example-prometheus-nodejs that referenced this issue Apr 22, 2020
@haysclark
Copy link

haysclark commented Apr 22, 2020

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 added a commit to haysclark/example-prometheus-nodejs that referenced this issue Apr 22, 2020
An alternative resolution for issue RisingStack#6, related to _prom/prometheus_ v1.x.x having a different schema for `rules` than the latest _prom/prometheus_ v2.x.x iterations.

Potentially, this fix could be tagged in a `v1` branch, and PR RisingStack#5 could be applied after in the `master` branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants