I recently switched to the new alering method within Grafana 8.3.3
I used to silence all my alerts with a api call on set times in the week because of server updates to not have false positives.
Now with the new alerting the API does not seem to work.
If i call to silence all alerts for the next 3 hiours i see no silence rule being added in the silence dashboard.
Is there a new API or different API?
What Grafana version and what operating system are you using?
RHEL8 with Grafana8.3.3
What are you trying to achieve?
Pause all alerts with API call
How are you trying to achieve it?
Calling the API from bash in crontab
What happened?
Nothing
What did you expect to happen?
Pausing of all alerts (like before the switch to the new grafana alerting)
Can you copy/paste the configuration(s) that you are having problems with?
n/a
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
n/a
Did you follow any online instructions? If so, what is the URL?
n/a
@waardd I am looking into this as it seems when we put silences in the Grafan UI they are not persistant if the server gets rebooted - so looking to do it via the API.
Couple of questions:
“startsAt”: “’$startSilence’” & “endsAt”: “’$endSilence’”
how have you set these within your call? is it day/month/year time?
I am gathering that the following are just tags on your alerts?
“name”: “env”,
“value”: “prod”
If you could help with this I would be most grateful
Stu
Hi! Silences for the Grafana Alertmanager should not be deleted if Grafana is restarted. It would be great to get more information about your version of Grafana and whether you use an external Alertmanager.
Could anyone create a silence with the API?
I’m using Grafana 10.0.1 and the POST for the path /api/alertmanager/grafana/api/v2/silences returns {"message":"silence not found","traceID":""} when trying to create a silence.
If I post with an existing silence values, the POST returns the ID of the existing silence.
You are right @yuriy.tseretyan , I was giving a dummy ID in the payload (I forgot to remove it). Without this property, the API created the silence. Thank you.
Any idea on how to create a silence with another timezone than UTC?
Iam using CEST/CET and my first approach was to change grafana server timezone but i couldnt figure out how to do that.