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
fefdb4eb
Commit
fefdb4eb
authored
Sep 03, 2015
by
Brian Brazil
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #205 from brian-brazil/bool
Document bool modifier
parents
8d3c5312
ebbab0d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
11 deletions
+21
-11
operators.md
content/docs/querying/operators.md
+21
-11
No files found.
content/docs/querying/operators.md
View file @
fefdb4eb
...
...
@@ -37,9 +37,9 @@ in the right hand vector. The result is propagated into the result vector and th
name is dropped. Entries for which no matching entry in the right-hand vector can be
found are not part of the result.
### Comparison
/filter
binary operators
### Comparison binary operators
The following binary comparison
/filter
operators exist in Prometheus:
The following binary comparison operators exist in Prometheus:
*
`==`
(equal)
*
`!=`
(not-equal)
...
...
@@ -48,21 +48,31 @@ The following binary comparison/filter operators exist in Prometheus:
*
`>=`
(greater-or-equal)
*
`<=`
(less-or-equal)
Comparison/filters operators are defined between scalar/scalar, vector/scalar,
and vector/vector value pairs.
Comparison operators are defined between scalar/scalar, vector/scalar,
and vector/vector value pairs. By default they filter. Their behaviour can be
modified by providing
`bool`
after the operator, which will return
`0`
or
`1`
for the value rather than filtering.
**Between two scalars**
, these operators result in another scalar that is
either
`0`
(
`false`
) or
`1`
(
`true`
), depending on the comparison result.
The
`bool`
modifier has no effect on this comparison, however it's
recommended to always provide it due to
[
upcoming changes
](
https://github.com/prometheus/prometheus/issues/482
)
.
**Between an instant vector and a scalar**
, these operators are applied to the
value of every data sample in the vector, and vector elements between which the
comparison result is
`false`
get dropped from the result vector.
**Between two instant vectors**
, these operators behave as a filter, applied to
matching entries. Vector elements for which the expression is not true or
which do not find a match on the other side of the expression get dropped from the
result, while the others are propagated into a result vector with their original
(left-hand-side) metric names and label values.
comparison result is
`false`
get dropped from the result vector. If the
`bool`
modifier is provided, vector elements that would be dropped instead have the value
`0`
and vector elements that would be kept have the value
`1`
.
**Between two instant vectors**
, these operators behave as a filter by default,
applied to matching entries. Vector elements for which the expression is not
true or which do not find a match on the other side of the expression get
dropped from the result, while the others are propagated into a result vector
with their original (left-hand-side) metric names and label values.
If the
`bool`
modifier is provided, vector elements that would have been
dropped instead have the value
`0`
and vector elements that would be kept have
the value
`1`
with the left-hand-side metric names and label values.
### Logical/set binary operators
...
...
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