mirror of
https://github.com/prometheus/prometheus.git
synced 2026-05-04 20:06:12 +02:00
Update duration expression docs
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
This commit is contained in:
parent
6d56e77e0e
commit
db15681633
@ -185,17 +185,25 @@ state is mutex guarded. Cumulative-only OTLP requests are not affected.
|
||||
|
||||
`--enable-feature=promql-duration-expr`
|
||||
|
||||
With this flag, arithmetic expressions can be used in time durations in range queries and offset durations. For example:
|
||||
With this flag, arithmetic expressions can be used in time durations in range queries and offset durations.
|
||||
|
||||
In range queries:
|
||||
rate(http_requests_total[5m * 2]) # 10 minute range
|
||||
rate(http_requests_total[(5+2) * 1m]) # 7 minute range
|
||||
```
|
||||
rate(http_requests_total[5m * 2]) # 10 minute range
|
||||
rate(http_requests_total[(5+2) * 1m]) # 7 minute range
|
||||
```
|
||||
|
||||
In offset durations:
|
||||
http_requests_total offset (1h / 2) # 30 minute offset
|
||||
http_requests_total offset ((2 ^ 3) * 1m) # 8 minute offset
|
||||
```
|
||||
http_requests_total offset (1h / 2) # 30 minute offset
|
||||
http_requests_total offset ((2 ^ 3) * 1m) # 8 minute offset
|
||||
```
|
||||
|
||||
Note: Duration expressions are not supported in the @ timestamp operator.
|
||||
When using offset with duration expressions, you must wrap the expression in
|
||||
parentheses. Without parentheses, only the first duration value will be used in
|
||||
the offset calculation.
|
||||
|
||||
**Note**: Duration expressions are not supported in the @ timestamp operator.
|
||||
|
||||
The following operators are supported:
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user