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
1d8a2fe3
Commit
1d8a2fe3
authored
Jul 15, 2016
by
Brian Brazil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add docs for new ^ operator
parent
9b602d3c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
operators.md
content/docs/querying/operators.md
+9
-6
No files found.
content/docs/querying/operators.md
View file @
1d8a2fe3
...
...
@@ -19,6 +19,7 @@ The following binary arithmetic operators exist in Prometheus:
*
`*`
(multiplication)
*
`/`
(division)
*
`%`
(modulo)
*
`^`
(power/exponentiation)
Binary arithmetic operators are defined between scalar/scalar, vector/scalar,
and vector/vector value pairs.
...
...
@@ -237,11 +238,13 @@ To get the 5 largest HTTP requests counts across all instances we could write:
The following list shows the precedence of binary operators in Prometheus, from
highest to lowest.
1.
`*`
,
`/`
,
`%`
2.
`+`
,
`-`
3.
`==`
,
`!=`
,
`<=`
,
`<`
,
`>=`
,
`>`
4.
`and`
,
`unless`
5.
`or`
1.
`^`
2.
`*`
,
`/`
,
`%`
3.
`+`
,
`-`
4.
`==`
,
`!=`
,
`<=`
,
`<`
,
`>=`
,
`>`
5.
`and`
,
`unless`
6.
`or`
Operators on the same precedence level are left-associative. For example,
`2 * 3 % 2`
is equivalent to
`(2 * 3) % 2`
.
`2 * 3 % 2`
is equivalent to
`(2 * 3) % 2`
. However
`^`
is right associative,
so
`2 * 3 ^ 2`
is equivilent to
`2 * (3 ^ 2)`
.
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