cloudflare/pint

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v0.74.7

Branches

Tags

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

Clone

HTTPS

Download ZIP

docs/checks/alerts/comparison.md

68lines · modecode

1---
2layout: default
3parent: Checks
4grand_parent: Documentation
5---
6
7# alerts/comparison
8
9This check enforces use of a comparison operator in alert queries.
10Any result returned by alerting rule query will trigger an alert, so it's
11recommended for all alert queries to have some condition `errors > 10`, so we
12only get `errors` series if the value is above 10.
13If we would remove `> 10` part query would always return `errors` and so it
14would always trigger an alert, even when `errors` value is `0`.
15
16In some cases time series or specific label values will only be exported to
17Prometheus under some conditions, for example `http_responses_total{code="504"}`
18might only be exported if there's at least one 504 error observed.
19This means that an alert with a query `http_responses_total{code="504"}` might
20work perfectly fine, since in practice we'll never have this specific time
21series in Prometheus with zero value.
22But this setup is fragile and unpredictable, so it's highly recommended to
23have always set conditions on alerts, especially that adding `> 0` shouldn't
24have any negative side effects.
25
26## Configuration
27
28This check doesn't have any configuration options.
29
30## How to enable it
31
32This check is enabled by default.
33
34## How to disable it
35
36You can disable this check globally by adding this config block:
37
38```js
39checks {
40 disabled = ["alerts/comparison"]
41}
42```
43
44You can also disable it for all rules inside given file by adding
45a comment anywhere in that file. Example:
46
47```yaml
48# pint file/disable alerts/comparison
49```
50
51Or you can disable it per rule by adding a comment to it. Example:
52
53```yaml
54# pint disable alerts/comparison
55```
56
57## How to snooze it
58
59You can disable this check until given time by adding a comment to it. Example:
60
61```yaml
62# pint snooze $TIMESTAMP alerts/comparison
63```
64
65Where `$TIMESTAMP` is either use [RFC3339](https://www.rfc-editor.org/rfc/rfc3339)
66formatted or `YYYY-MM-DD`.
67Adding this comment will disable `alerts/comparison` *until* `$TIMESTAMP`, after that
68check will be re-enabled.
69