cloudflare/pint

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
main

Branches

Tags

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

Clone

HTTPS

Download ZIP

docs/checks/alerts/absent.md

94lines · modecode

1---
2layout: default
3parent: Checks
4grand_parent: Documentation
5---
6
7# alerts/absent
8
9This check will warn you about alerting rules that are using `absent()` calls without having `for` option set
10to at least 2x scrape interval.
11Using `absent()` without `for` can cause false positive alerts when Prometheus is restarted and the rule
12is evaluated before the metrics tested using `absent()` are scraped. Adding a `for` option with at least
132x scrape interval is usually enough to prevent this from happening.
14
15## Configuration
16
17This check doesn't have any configuration options.
18
19## How to enable it
20
21This check is enabled by default for all configured Prometheus servers.
22
23Example:
24
25```js
26prometheus "prod" {
27 uri = "https://prometheus-prod.example.com"
28 timeout = "60s"
29 include = [
30 "rules/prod/.*",
31 "rules/common/.*",
32 ]
33}
34
35prometheus "dev" {
36 uri = "https://prometheus-dev.example.com"
37 timeout = "30s"
38 include = [
39 "rules/dev/.*",
40 "rules/common/.*",
41 ]
42}
43```
44
45## How to disable it
46
47You can disable this check globally by adding this config block:
48
49```js
50checks {
51 disabled = ["alerts/absent"]
52}
53```
54
55You can also disable it for all rules inside a given file by adding
56a comment anywhere in that file. Example:
57
58```yaml
59# pint file/disable alerts/absent
60```
61
62Or you can disable it per rule by adding a comment to it. Example:
63
64```yaml
65# pint disable alerts/absent
66```
67
68If you want to disable only individual instances of this check
69you can add a more specific comment.
70
71```yaml
72# pint disable alerts/absent($prometheus)
73```
74
75Where `$prometheus` is the name of Prometheus server to disable.
76
77Example:
78
79```yaml
80# pint disable alerts/absent(prod)
81```
82
83## How to snooze it
84
85You can disable this check until a given time by adding a comment to it. Example:
86
87```yaml
88# pint snooze $TIMESTAMP alerts/absent
89```
90
91Where `$TIMESTAMP` is either [RFC3339](https://www.rfc-editor.org/rfc/rfc3339)
92formatted or `YYYY-MM-DD`.
93Adding this comment will disable `alerts/absent` *until* `$TIMESTAMP`, after which
94the check will be re-enabled.
95