cloudflare/pint

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v0.84.0

Branches

Tags

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

Clone

HTTPS

Download ZIP

docs/checks/rule/duplicate.md

103lines · modecode

1---
2layout: default
3parent: Checks
4grand_parent: Documentation
5---
6
7# rule/duplicate
8
9This check will find and report any duplicated recording rules.
10
11When Prometheus is configured with two identical recording rules that
12are producing the exact time series it will discard results from one
13of them. When that happens Prometheus will log a warning counting
14discarded samples, example:
15
16```text
17msg="Error on ingesting results from rule evaluation with different value but same timestamp" num_dropped=...
18```
19
20Duplicated rule itself is not catastrophic but it will cause constant unnecessary
21logs that might hide other issues and can lead to other problems if the
22duplicated rule is later updated, but only in one place, not in both.
23
24## Configuration
25
26This check doesn't have any configuration options.
27
28## How to enable it
29
30This check is enabled by default for all configured Prometheus servers.
31
32Example:
33
34```js
35prometheus "prod" {
36 uri = "https://prometheus-prod.example.com"
37 timeout = "60s"
38 include = [
39 "rules/prod/.*",
40 "rules/common/.*",
41 ]
42}
43
44prometheus "dev" {
45 uri = "https://prometheus-dev.example.com"
46 timeout = "30s"
47 include = [
48 "rules/dev/.*",
49 "rules/common/.*",
50 ]
51}
52```
53
54## How to disable it
55
56You can disable this check globally by adding this config block:
57
58```js
59checks {
60 disabled = ["rule/duplicate"]
61}
62```
63
64You can also disable it for all rules inside given file by adding
65a comment anywhere in that file. Example:
66
67```yaml
68# pint file/disable rule/duplicate
69```
70
71Or you can disable it per rule by adding a comment to it. Example:
72
73```yaml
74# pint disable rule/duplicate
75```
76
77If you want to disable only individual instances of this check
78you can add a more specific comment.
79
80```yaml
81# pint disable rule/duplicate($prometheus)
82```
83
84Where `$prometheus` is the name of Prometheus server to disable.
85
86Example:
87
88```yaml
89# pint disable rule/duplicate(prod)
90```
91
92## How to snooze it
93
94You can disable this check until given time by adding a comment to it. Example:
95
96```yaml
97# pint snooze $TIMESTAMP rule/duplicate
98```
99
100Where `$TIMESTAMP` is either [RFC3339](https://www.rfc-editor.org/rfc/rfc3339)
101formatted or `YYYY-MM-DD`.
102Adding this comment will disable `rule/duplicate` *until* `$TIMESTAMP`, after that
103check will be re-enabled.
104