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

Rules became invalid in 0.18.0rc1 #1539

Closed
hryamzik opened this Issue Apr 9, 2016 · 11 comments

Comments

Projects
None yet
7 participants
@hryamzik
Copy link

hryamzik commented Apr 9, 2016

This rule:

ALERT low_disk_space
  IF round(node_filesystem_free * 100 / node_filesystem_size) < 15
  SUMMARY "Less than {{$value}}% left on disk {{$labels.mountpoint}}, host {{$labels.instance}}"

results in

FAILED: parse error at line 6, char 12: unexpected string "\"Less than"... in record statement, expected "="

The same about this rule:

ALERT node_down
  IF up == 0
  FOR 5m
  WITH {
    severity="page"
  }
  SUMMARY "Instance {{$labels.instance}} down"
  DESCRIPTION "{{$labels.instance}} of job {{$labels.job}} has been down for more than 5 minutes."
FAILED: parse error at line 15, char 4: unexpected identifier "SUMMARY" in record statement, expected "="

Replacing DESCRIPTION and SUMMARY to a single ANNOTATIONS line doesn't help. What am I doing wrong?

@hryamzik

This comment has been minimized.

Copy link
Author

hryamzik commented Apr 9, 2016

OK, it turns out the correct syntax now is as follows:

ALERT node_down
  IF up == 0
  FOR 5m
  LABELS {
    severity="page"
  }
  ANNOTATIONS {
      summary = "Instance {{$labels.instance}} down",
      description = "{{$labels.instance}} of job {{$labels.job}} has been down for more than 5 minutes."
  }

@hryamzik hryamzik closed this Apr 9, 2016

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Apr 9, 2016

Yes, we kept both variants working for 0.17.0 and finally dropped support
for the old one in 0.18.0.
@discordianfish has a script that converts the syntax automatically.

On Sat, Apr 9, 2016 at 12:39 PM Roman Belyakovsky notifications@github.com
wrote:

Closed #1539 #1539.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#1539 (comment)

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Apr 9, 2016

@fabxc Shouldn't that be explicitly listed in the 0.18.0rc1 changelog entry again?

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Apr 9, 2016

Yes, it should – forgot about that. Changing.

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Apr 9, 2016

👍

@discordianfish

This comment has been minimized.

Copy link
Member

discordianfish commented Apr 11, 2016

@xbglowx

This comment has been minimized.

Copy link

xbglowx commented Apr 11, 2016

The gist above is for the setup where every alerting rule is in its own separate file. Only tested on my environment.

@JakimLi

This comment has been minimized.

Copy link

JakimLi commented May 14, 2016

change to ANNOTATIONS doesn't help, keep giving errors like:

"Error loading rules, previous rule set restored: error parsing /workshop_alerting.rules: parse error at line 10, char 4: unexpected <ANNOTATIONS> in record statement, expected \"=\"" source="manager.go:419"

And my rules are like:

ALERT ReviewServiceNoInstances
  IF absent(max_over_time(consul_health_service_status{service="review-service-admin"}[30s])) == 1
  FOR 30s
  WITH {
    severity="page"
  }
  ANNOTATIONS {
    summary = "Review service has no registered instances",
    description = "All instances of review service have been down for more than 30 seconds.",
  }

Am I missing anything?

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented May 14, 2016

WITH is now LABELS

@JakimLi

This comment has been minimized.

Copy link

JakimLi commented May 14, 2016

@brian-brazil, thanks so much, you just saved my evening (I am so stupid).

@fabxc fabxc added kind/question and removed kind/support labels May 17, 2016

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 24, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.