forked from cloudflare/pint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
1,222 additions
and
454 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
--- | ||
layout: default | ||
parent: Checks | ||
grand_parent: Documentation | ||
--- | ||
|
||
# promql/range_query | ||
|
||
This check inspects range query selectors on all queries. | ||
It will warn if a query tries to request a time range that | ||
is bigger than Prometheus retention limits. | ||
|
||
By default Prometheus keeps [15 days of data](https://prometheus.io/docs/prometheus/latest/storage/#operational-aspects), | ||
this can be customized by setting time or disk space limits. | ||
There are two main ways of configuring retention limits in Prometheus: | ||
* time based - Prometheus will keep last N days of metrics | ||
* disk based - Prometheus will try to use up to N bytes of disk space. | ||
|
||
Pint will ignore any disk space limits, since that doesn't tell us | ||
what the effective time retention is. | ||
But it will check the value of `--storage.tsdb.retention.time` flag passed | ||
to Prometheus and it will warn if any selector tries to query more | ||
data then Prometheus can store. | ||
|
||
For example if Prometheus is running with `--storage.tsdb.retention.time=30d` | ||
then it will store up to 30 days of historical metrics data. | ||
If we would try to query `foo[40d]` then that query can only return up | ||
to 30 days of data, it will never return more. | ||
|
||
This usually isn't really a problem but can indicate a mismatch between | ||
expectations of data retention and reality, and so you might think that by | ||
getting results of a `avg_over_time(foo[40d])` you are getting the average | ||
value of `foo` in the last 40 days, but in reality you're only getting | ||
an average value in the last 30 days, and you cannot get any more than that. | ||
|
||
## Configuration | ||
|
||
This check doesn't have any configuration options. | ||
|
||
## How to enable it | ||
|
||
This check is enabled by default for all configured Prometheus servers. | ||
|
||
Example: | ||
|
||
```js | ||
prometheus "prod" { | ||
uri = "https://prometheus-prod.example.com" | ||
timeout = "60s" | ||
paths = [ | ||
"rules/prod/.*", | ||
"rules/common/.*", | ||
] | ||
} | ||
|
||
prometheus "dev" { | ||
uri = "https://prometheus-dev.example.com" | ||
timeout = "30s" | ||
paths = [ | ||
"rules/dev/.*", | ||
"rules/common/.*", | ||
] | ||
} | ||
``` | ||
|
||
## How to disable it | ||
|
||
You can disable this check globally by adding this config block: | ||
|
||
```js | ||
checks { | ||
disabled = ["promql/range_query"] | ||
} | ||
``` | ||
|
||
Or you can disable it per rule by adding a comment to it: | ||
|
||
`# pint disable promql/range_query` | ||
|
||
If you want to disable only individual instances of this check | ||
you can add a more specific comment. | ||
|
||
`# pint disable promql/range_query($prometheus)` | ||
|
||
Where `$prometheus` is the name of Prometheus server to disable. | ||
|
||
Example: | ||
|
||
`# pint disable promql/range_query(prod)` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.