Welcome to the forum. I presume you read through (and maybe tried) this? Am guessing you could find a way to automatically silence alerts based on a given schedule.
Yes, I went through the documentation for Silences but found 2 things:
There is no way to specify relative silences based on the day of the week (like weekends), or the ability to use a “holiday” calendar
There is no REST API to create/delete silences. That, with a little bit of work, would make it easier to create silences for alerts using absolute dates, etc. (like pre-populate silences for the week).
I keep reading mentions of external alerts like alertmanager on the documentation, is that the way to go with this?
Hi @jnunez2 I am using Grafana OSS 9.0.5 and literally just getting started with Silences (set up my first one yesterday), but like you, I kept seeing references in the documentation to alert managers (which honestly I do not know what they are referring to). So maybe in the coming days I will have a better answer. My guess is that they either have created or will create something (Rest API or whatever) to specify the time/day/week/etc. that a silence should go into effect.
On a side note, have you used Node-RED? If an http interface for the silences exist, I am thinking it would be a piece of cake to set one’s “calendar” in Node-RED and then inject that info regularly to Grafana. For example: M - F, turn on silence for alerts A & B from 12 noon to 1 pm, Sat - Sun, turn on silence for alerts C & D from 12 am to 11:59 pm, etc.
OK, should have done some reading before my last post.
The link that @yosiasz sent was for Grafana 7.5 (not sure what has changed since then on this particular subject). I found the updated docs for 9.0.x and learned that one can create mute timings via http API. So I will definitely use Node-RED and give this a try today or this weekend.
From the docs…
Similar to silences, mute timings do not prevent alert rules from being evaluated, nor do they stop alert instances from being shown in the user interface. They only prevent notifications from being created.
[EDIT] Doesn’t seem to work as no labels are shared
I had the same problem and just figured out how to create a “mask” metric which will disable alerts outside working hours.
Here it is :
(vector(1) and on() hour() >= vector(6) <= vector(16) and on() day_of_week() >= vector(1) <= vector(5)) or vector(0)