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

Add thresholds to Alerts #3143

Closed
sylr opened this Issue Sep 6, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@sylr
Copy link
Contributor

sylr commented Sep 6, 2017

Hi,

I think Prometheus Alert system is lacking a real thresholds mechanism.

To me duplicating alerts with different conditions and label is a rather ugly workaround.

Something like this would be nice (it's really just to demonstrate, no a request to implement that exact syntax):

ALERT node_cpu_iowait
IF round(avg(rate(node_cpu{mode="iowait"}[2m]) * ON(instance) GROUP_LEFT(nodename) node_uname_info) BY (nodename) * 100)
FOR 5m
THRESHOLDS [
    {ge=20, labels=[severity="critical"]},
    {ge=10, lt=20, labels=[severity="warning"]},
]
LABELS {
}
ANNOTATIONS {
    description="Node {{ $labels.nodename }} has {{ $value }}% of iowait", 
    summary="{{ $labels.nodename }} - High CPU iowait (> 15%)"
}

Cheers.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Sep 6, 2017

This is something we're very unlikely to implement. PromQL expressions and thus alerts can be far more sophisticated than a simple threshold would allow for. It's suggested to use configuration management if the repetition is an issue for you.

@lock

This comment has been minimized.

Copy link

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