cloudflare/pint

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v0.15.2

Branches

Tags

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

Clone

HTTPS

Download ZIP

docs/checks/alerts/count.md

86lines · modecode

1---
2layout: default
3parent: Checks
4grand_parent: Documentation
5---
6
7# alerts/count
8
9This check is used to estimate how many times given alert would fire.
10It will run `expr` query from every alert rule against selected Prometheus
11servers and report how many unique alerts it would generate.
12If `for` is set on alerts it will be used to adjust results.
13
14In some cases queries might fail due to timeout or loading too many samples.
15This check will try to retry such queries with a shorter `range` until it
16gets a response.
17
18## Configuration
19
20Syntax:
21
22```js
23alerts {
24 range = "1h"
25 step = "1m"
26 resolve = "5m"
27}
28```
29
30- `range` - query range, how far to look back, `1h` would mean that pint will
31 query last 1h of metrics. If a query results in a timeout pint will retry it
32 with 50% smaller range until it succeeds.
33 Defaults to `1d`.
34- `step` - query resolution, for most accurate result use step equal
35 to `scrape_interval`, try to reduce it if that would load too many samples.
36 Defaults to `1m`.
37- `resolve` - duration after which stale alerts are resolved. Defaults to `5m`.
38
39## How to enable it
40
41This check is not enabled by default as it requires explicit configuration
42to work.
43To enable it add one or more `prometheus {...}` blocks and a `rule {...}` block
44with this checks config.
45
46Example:
47
48```js
49prometheus "prod" {
50 uri = "https://prometheus-prod.example.com"
51 timeout = "60s"
52}
53
54rule {
55 alerts {
56 range = "1d"
57 step = "1m"
58 resolve = "5m"
59 }
60}
61```
62
63## How to disable it
64
65You can disable this check globally by adding this config block:
66
67```js
68checks {
69 disabled = ["alerts/count"]
70}
71```
72
73Or you can disable it per rule by adding a comment to it.
74
75`# pint disable alerts/count`
76
77If you want to disable only individual instances of this check
78you can add a more specific comment.
79
80`# pint disable alerts/count($prometheus)`
81
82Where `$prometheus` is the name of Prometheus server to disable.
83
84Example:
85
86`# pint disable alerts/count(prod)`
87