Commit 3011686c authored by Julius Volz's avatar Julius Volz

Merge branch 'master' of github.com:prometheus/docs

parents 06a6813b 5560f426
......@@ -10,6 +10,24 @@ sort_rank: 3
`abs(v vector)` returns the input vector with all sample values converted to
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(v instant-vector)` returns the number of elements in a time series
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment