Commit f227c8e8 authored by Harsh Agarwal's avatar Harsh Agarwal Committed by Brian Brazil

document label_join (#825)

parent b1668565
...@@ -241,6 +241,17 @@ or a function aggregating over time (any function ending in `_over_time`), ...@@ -241,6 +241,17 @@ or a function aggregating over time (any function ending in `_over_time`),
always take a `irate()` first, then aggregate. Otherwise `irate()` cannot detect always take a `irate()` first, then aggregate. Otherwise `irate()` cannot detect
counter resets when your target restarts. counter resets when your target restarts.
## `label_join()`
For each timeseries in `v`, `label_join(v instant-vector, dst_label string, separator string, src_label_1 string, src_label_2 string, ...)` joins all the values of all the `src_labels`
using `separator` and returns the timeseries with the label `dst_label` containing the joined value.
There can be any number of `src_labels` in this function.
This example will return a vector with each time series having a `foo` label with the value `a,b,c` added to it:
```
label_join(up{job="api-server",src1="a",src2="b",src3="c"}, "foo", ",", "src1", "src2", "src3")
```
## `label_replace()` ## `label_replace()`
For each timeseries in `v`, `label_replace(v instant-vector, dst_label string, replacement string, For each timeseries in `v`, `label_replace(v instant-vector, dst_label string, replacement string,
......
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