cloudflare/pint

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v0.71.1

Branches

Tags

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

Clone

HTTPS

Download ZIP

docs/checks/promql/impossible.md

69lines · modecode

1---
2layout: default
3parent: Checks
4grand_parent: Documentation
5---
6
7# promql/impossible
8
9This check will report PromQL queries that can never return anything.
10
11Example query:
12
13```js
14foo{job="bar"} unless sum(foo)
15```
16
17The right hand side (`unless sum(foo)`) cannot ever match any time series returned by the left hand side
18(`foo{job="bar"}`) because `sum()` strips away all labels. This means that we end up with left hand side
19having at least the `job` label, while the right hand side has no labels, so we end up with:
20
21```js
22foo{job="bar"} unless {}
23```
24
25Both sides can only match if they have the same label set, see [Prometheus docs](https://prometheus.io/docs/prometheus/latest/querying/operators/#vector-matching). A result with `{job="bar"}` will never be matched with empty label set `{}`.
26
27## Configuration
28
29This check doesn't have any configuration options.
30
31## How to enable it
32
33This check is enabled by default.
34
35## How to disable it
36
37You can disable this check globally by adding this config block:
38
39```js
40checks {
41 disabled = ["promql/impossible"]
42}
43```
44
45You can also disable it for all rules inside given file by adding
46a comment anywhere in that file. Example:
47
48```yaml
49# pint file/disable promql/impossible
50```
51
52Or you can disable it per rule by adding a comment to it. Example:
53
54```yaml
55# pint disable promql/impossible
56```
57
58## How to snooze it
59
60You can disable this check until given time by adding a comment to it. Example:
61
62```yaml
63# pint snooze $TIMESTAMP promql/impossible
64```
65
66Where `$TIMESTAMP` is either use [RFC3339](https://www.rfc-editor.org/rfc/rfc3339)
67formatted or `YYYY-MM-DD`.
68Adding this comment will disable `promql/impossible` *until* `$TIMESTAMP`, after that
69check will be re-enabled.
70