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