Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding multiple alerts on single grafana panel

I have configured grafana dashboard to monitor promethus metrics for some of the spring boot services. I have a single panel and a prom query for every service on it.

Now I want to add alerts for each on of those queries. But I couldn't find a way to add multiple alerts on single panel. I could add only only for one of the queries.

Is there a way to do it? Or would I need to split panel into multiple panels?

like image 686
Mandroid Avatar asked Aug 04 '20 11:08

Mandroid


People also ask

How do I add multiple alerts in Grafana?

You can quickly duplicate them by using the panel json and a search/replace for the node name, service name etc. Save this answer. Show activity on this post. As Andrew Poodle mentioned, you can create multiple queries in that single panel and use the "multiple conditions" feature in the alert section.

Does Grafana provide alerts?

Grafana Alerting allows you to alert on your metrics and logs, no matter where they are stored. Create, manage, and take action on your alerts in a single, consolidated view, and improve your team's ability to identify and resolve issues quickly.

How do Grafana Alerts work?

Grafana alerts are a way to send notifications when a metric crosses a threshold you have configured. For example, you might want to send a Slack message to your team's channel when your cloud server's CPU utilization exceeds 80 percent.


2 Answers

You can specify the query that the alert threshold is evaluating within the 'conditions' but it will still be just one alert. As such your Alert message won't include anything to distinguish which specific query condition triggered the alert, it's just whatever text is in the box (AFAIK there's not currently any way to add variables to the alert message).

I've ended up with a separate dashboard which isn't generally viewed, just for alerts with multiple panels for each alert. You can quickly duplicate them by using the panel json and a search/replace for the node name, service name etc.

like image 178
Andrew Poodle Avatar answered Sep 27 '22 23:09

Andrew Poodle


As Andrew Poodle mentioned, you can create multiple queries in that single panel and use the "multiple conditions" feature in the alert section. They will be under one alert.

However, you can use the grafana notification templating in order to distinguish your alert conditions as seen in the pic below.

enter image description here

like image 42
Joe Haddad Avatar answered Sep 28 '22 01:09

Joe Haddad