Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
docs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
docs
Commits
38a24dc3
Commit
38a24dc3
authored
Feb 24, 2015
by
beorn7
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document offset modifier.
parent
102d9c86
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
basics.md
content/docs/querying/basics.md
+24
-0
No files found.
content/docs/querying/basics.md
View file @
38a24dc3
...
@@ -107,6 +107,30 @@ a `job` label set to `prometheus`:
...
@@ -107,6 +107,30 @@ a `job` label set to `prometheus`:
http_requests_total{job="prometheus"}[5m]
http_requests_total{job="prometheus"}[5m]
### Offset modifier
The
`offset`
modifier allows changing the time offset for individual
instant and range vectors in a query.
For example, the following expression returns the value of
`foo`
5
minutes in the past relative to the current query evaluation time:
foo offset 5m
Note that the
`offset`
modifier always needs to follow the selector
immediately, i.e. the following would be correct:
sum(foo offset 5m) // GOOD.
While the following would be
*incorrect*
:
sum(foo) offset 5m // INVALID.
The same works for range vectors. This returns the 5-minutes rate that
`foo`
had a week ago:
rate(foo[5m] offset 1w)
## Operators
## Operators
Prometheus supports many binary and aggregation operators. These are described
Prometheus supports many binary and aggregation operators. These are described
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment