This is documentation for the next version of Grafana. For the latest stable release, go to the latest version.
Configure silences
Silences stop notifications from getting created and last for only a specified window of time.
Note
- Inhibition rules are not supported in the Grafana Alertmanager.
- The preview of silenced alerts only applies to alerts in firing state.
Add silences
To add a silence, complete the following steps.
In the left-side menu, click Alerts & IRM and then Alerting.
Click Silences.
From the Alertmanager dropdown, select an external Alertmanager to create and manage silences for the external data source. Otherwise, keep the default option of Grafana.
Click Create silence to open the Create silence page.
In Silence start and end, select the start and end date to indicate when the silence should go into effect and expire.
Optionally, in Duration, specify how long the silence is enforced. This automatically updates the end time in the Silence start and end field.
In the Label and Value fields, enter one or more Matching Labels. Matchers determine which rules the silence will apply to. Any matching alerts (in firing state) will show in the Silenced alert instances field
Use labels and label matchers to link alert rules to notification policies and silences. This allows for a flexible way to manage your alert instances, specify which policy should handle them, and which alerts to silence.
A label matchers consists of 3 distinct parts, the label, the value and the operator.
The Label field is the name of the label to match. It must exactly match the label name.
The Value field matches against the corresponding value for the specified Label name. How it matches depends on the Operator value.
The Operator field is the operator to match against the label value. The available operators are:
Operator Description =
Select labels that are exactly equal to the value. !=
Select labels that are not equal to the value. =~
Select labels that regex-match the value. !~
Select labels that do not regex-match the value.
Note
If you are using multiple label matchers, they are combined using the AND logical operator. This means that all matchers must match in order to link a rule to a policy.Label matching example
If you define the following set of labels for your alert:
{ foo=bar, baz=qux, id=12 }
then:
- A label matcher defined as
foo=bar
matches this alert rule. - A label matcher defined as
foo!=bar
does not match this alert rule. - A label matcher defined as
id=~[0-9]+
matches this alert rule. - A label matcher defined as
baz!~[0-9]+
matches this alert rule. - Two label matchers defined as
foo=bar
andid=~[0-9]+
match this alert rule.
Exclude labels
You can also write label matchers to exclude labels.
Here is an example that shows how to exclude the label
Team
. You can choose between any of the values below to exclude labels.Label Operator Value team
=
""
team
!~
.+
team
=~
^$
In Comment, add details about the silence.
Click Submit.
Edit silences
To edit a silence, complete the following steps.
- In the left-side menu, click Alerts & IRM and then Alerting.
- Click Silences to view the list of existing silences.
- Find the silence you want to edit, then click Edit (pen icon).
- Make the desired changes, then click Submit to save your changes.
Create a URL to link to a silence form
When linking to a silence form, provide the default matching labels and comment via matcher
and comment
query parameters. The matcher
parameter should be in the following format [label][operator][value]
where the operator
parameter can be one of the following: =
(equals, not regular expression), !=
(not equals, not regular expression), =~
(equals, regular expression), !~
(not equals, regular expression).
The URL can contain many query parameters with the key matcher
.
For example, to link to silence form with matching labels severity=critical
& cluster!~europe-.*
and comment Silence critical EU alerts
, create a URL https://mygrafana/alerting/silence/new?matcher=severity%3Dcritical&matcher=cluster!~europe-*&comment=Silence%20critical%20EU%20alert
.
To link to a new silence page for an external Alertmanager, add a alertmanager
query parameter with the Alertmanager data source name.
Remove silences
To remove a silence, complete the following steps.
- In the left-side menu, click Alerts & IRM and then Alerting.
- Click Silences to view the list of existing silences.
- Select the silence you want to end, then click Unsilence.
Note: You cannot remove a silence manually. Silences that have ended are retained and listed for five days.
Rule-specific silences
Rule-specific silences are silences that apply only to a specific alert rule. They’re created when you silence an alert rule directly using the Silence notifications action in the UI.
Note
As opposed to general silences, rule-specific silence access is tied directly to the alert rule they act on. They can be created manually by including the specific label matcher:__alert_rule_uid__=<alert rule UID>
.