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/rule/duplicate.md

102lines · 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 you will see warnings in logs, example:
14
15```text
16msg="Rule evaluation result discarded" err="duplicate sample for timestamp"
17```
18
19Duplicated rule itself is not catastrophic but it will cause constant unnecessary
20logs that might hide other issues and can lead to other problems if the
21duplicated rule is later updated, but only in one place, not in both.
22
23## Configuration
24
25This check doesn't have any configuration options.
26
27## How to enable it
28
29This check is enabled by default for all configured Prometheus servers.
30
31Example:
32
33```js
34prometheus "prod" {
35 uri = "https://prometheus-prod.example.com"
36 timeout = "60s"
37 include = [
38 "rules/prod/.*",
39 "rules/common/.*",
40 ]
41}
42
43prometheus "dev" {
44 uri = "https://prometheus-dev.example.com"
45 timeout = "30s"
46 include = [
47 "rules/dev/.*",
48 "rules/common/.*",
49 ]
50}
51```
52
53## How to disable it
54
55You can disable this check globally by adding this config block:
56
57```js
58checks {
59 disabled = ["rule/duplicate"]
60}
61```
62
63You can also disable it for all rules inside given file by adding
64a comment anywhere in that file. Example:
65
66```yaml
67# pint file/disable rule/duplicate
68```
69
70Or you can disable it per rule by adding a comment to it. Example:
71
72```yaml
73# pint disable rule/duplicate
74```
75
76If you want to disable only individual instances of this check
77you can add a more specific comment.
78
79```yaml
80# pint disable rule/duplicate($prometheus)
81```
82
83Where `$prometheus` is the name of Prometheus server to disable.
84
85Example:
86
87```yaml
88# pint disable rule/duplicate(prod)
89```
90
91## How to snooze it
92
93You can disable this check until given time by adding a comment to it. Example:
94
95```yaml
96# pint snooze $TIMESTAMP rule/duplicate
97```
98
99Where `$TIMESTAMP` is either use [RFC3339](https://www.rfc-editor.org/rfc/rfc3339)
100formatted or `YYYY-MM-DD`.
101Adding this comment will disable `rule/duplicate` *until* `$TIMESTAMP`, after that
102check will be re-enabled.
103