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

parse error in expression in alert rule #3761

Closed
pznamensky opened this Issue Jan 30, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@pznamensky
Copy link

pznamensky commented Jan 30, 2018

What did you do?
Pasted correct PromQL expression into alerting rule
The rule looks like:

groups:
- name: MySweetGroup
  rules:
  - alert: MySweetRule
    expr: max(allocation_memory)  by (exported_job) / max(allocation_memory_limit) by (exported_job) > 0.8
    for: 5m
    labels:
      severity: info
    annotations:
      summary: Oops

What did you expect to see?
Working alert

What did you see instead? Under which circumstances?
Prometheus error:

caller=manager.go:479 component="rule manager" msg="loading groups failed" err="group \"MySweetGroup\", rule 0, \"MySweetRule\": could not parse expression: parse error at char 52: unexpected <by> in aggregation, expected \")\""
  • Prometheus version:
prometheus, version 2.1.0 (branch: HEAD, revision: 85f23d82a045d103ea7f3c89a91fba4a93e6367a)
  build user:       root@6e784304d3ff
  build date:       20180119-12:01:23
  go version:       go1.9.2
@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Jan 30, 2018

That parses for me fine with 2.1.0, are you sure that's the file you're using?

@pznamensky

This comment has been minimized.

Copy link
Author

pznamensky commented Jan 30, 2018

Oh, I'm sorry.
I checked the rule twice but didn't find any errors.
Indeed real expression is very long and I missed right bracket.
My bad.

@pznamensky pznamensky closed this Jan 30, 2018

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Jan 30, 2018

No problem, glad you sorted it out.

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 22, 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 22, 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.