Adding multiple alerts on single grafana panel
Asked Answered
I

2

16

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?

Inelegance answered 4/8, 2020 at 11:17 Comment(0)
C
21

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.

Conjuration answered 17/2, 2021 at 11:20 Comment(0)
B
2

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

Bifoliolate answered 2/3, 2022 at 18:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.