Commit 8cb197c5 authored by Tobias Schmidt's avatar Tobias Schmidt Committed by Brian Brazil

Improve readability of absent() documentation (#711)

This is just swapping two paragraphs and moves the explanation of the
example after the example itself.
parent 040c3a58
...@@ -18,12 +18,12 @@ their absolute value. ...@@ -18,12 +18,12 @@ their absolute value.
## `absent()` ## `absent()`
`absent(v instant-vector)` returns an empty vector if the vector passed to it has any `absent(v instant-vector)` returns an empty vector if the vector passed to it
elements and a 1-element vector with the value 1 if the vector passed to it has has any elements and a 1-element vector with the value 1 if the vector passed to
no elements. it has no elements.
In the second case, `absent()` tries to be smart about deriving labels of This is useful for alerting on when no time series exist for a given metric name
the 1-element output vector from the input vector: and label combination.
``` ```
absent(nonexistent{job="myjob"}) absent(nonexistent{job="myjob"})
...@@ -36,8 +36,8 @@ absent(sum(nonexistent{job="myjob"})) ...@@ -36,8 +36,8 @@ absent(sum(nonexistent{job="myjob"}))
# => {} # => {}
``` ```
This is useful for alerting on when no time series In the second example, `absent()` tries to be smart about deriving labels of the
exist for a given metric name and label combination. 1-element output vector from the input vector.
## `ceil()` ## `ceil()`
......
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