cloudflare/pint

Public

mirrored from https://github.com/cloudflare/pintAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v0.75.0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

docs/checks/alerts/template.md

71lines · modecode

1---
2layout: default
3parent: Checks
4grand_parent: Documentation
5---
6
7# alerts/template
8
9This check validates templates used in annotations and labels for alerting rules.
10See [Prometheus docs](https://prometheus.io/docs/prometheus/latest/configuration/template_reference/)
11for details of supported template syntax.
12
13This check will also inspect all alert rules and warn if any of them
14uses query return values inside alert labels.
15Two alerts are identical if they have identical labels, so using
16query value will generate a new unique alert every time it changes.
17If alerting rule is using `for` it might prevent it from ever firing
18if the value keeps changing before `for` is satisfied, because
19Prometheus will consider it to be a new alert and start `for` tracking
20from zero.
21
22If you want to include query value in the alert then use annotations
23for that. Annotations are not used to compare alerts identity and so
24the value of any annotation can change between alert evaluations.
25
26See [this blog post](https://www.robustperception.io/dont-put-the-value-in-alert-labels)
27for more details.
28
29## Configuration
30
31This check doesn't have any configuration options.
32
33## How to enable it
34
35This check is enabled by default.
36
37## How to disable it
38
39You can disable this check globally by adding this config block:
40
41```js
42checks {
43 disabled = ["alerts/template"]
44}
45```
46
47You can also disable it for all rules inside given file by adding
48a comment anywhere in that file. Example:
49
50```yaml
51# pint file/disable alerts/template
52```
53
54Or you can disable it per rule by adding a comment to it. Example:
55
56```yaml
57# pint disable alerts/template
58```
59
60## How to snooze it
61
62You can disable this check until given time by adding a comment to it. Example:
63
64```yaml
65# pint snooze $TIMESTAMP alerts/template
66```
67
68Where `$TIMESTAMP` is either use [RFC3339](https://www.rfc-editor.org/rfc/rfc3339)
69formatted or `YYYY-MM-DD`.
70Adding this comment will disable `alerts/template` *until* `$TIMESTAMP`, after that
71check will be re-enabled.
72