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
6fa47040
Commit
6fa47040
authored
Jan 20, 2015
by
Brian Brazil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make documentation for absent() not, uhm, absent
parent
c5234641
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
functions.md
content/docs/querying/functions.md
+18
-0
No files found.
content/docs/querying/functions.md
View file @
6fa47040
...
@@ -10,6 +10,24 @@ sort_rank: 3
...
@@ -10,6 +10,24 @@ sort_rank: 3
`abs(v vector)`
returns the input vector with all sample values converted to
`abs(v vector)`
returns the input vector with all sample values converted to
their absolute value.
their absolute value.
## `absent(v vector)`
`absent(v vector)`
returns an empty vector if the vector passed to it has any
elements and a 1-element vector with the value 1 if the vector passed to it has
no elements.
In the second case,
`absent()`
tries to be smart about deriving labels of
the 1-element output vector from the input vector:
| Expression | Result
|--------------------------------------------------|--------
| absent(nonexistent{job="myjob"}) | {job="myjob"}
| absent(nonexistent{job="myjob",instance=~".
*
"}) | {job="myjob"}
| absent(sum(nonexistent{job="myjob"})) | {}
This is useful for alerting on when no time series
exist for a given metric name and label combination.
## `count_scalar()`
## `count_scalar()`
`count_scalar(v instant-vector)`
returns the number of elements in a time series
`count_scalar(v instant-vector)`
returns the number of elements in a time series
...
...
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