Hi All,

I am interested in adding (or having) a new function join_label_sorted()
which will be similar to join_label(). It is described as:

For each timeseries in v, label_join_sorted(v instant-vector, dst_label,
string, separator string, src_label1 string, src_label2 string...) joins
all the values of all the src_labels using separator and returns the
timeseries with the label dst_label contained the joined value such that
joined value is concatenation of original values in sorted order. There can
be any number of src_labels in this function.

The following example will return a vector with each time series having a
foo label with the value 7_9_12 added to it.

label_join_sorted(up{job="api-server",src1="12",src2="7",src3="9"}, "foo",
"_", "src1", "src2", "src3")

It will help me write alarming rules where I can do group by based on
the composite label-value. I am not sure if we can achieve it today using
UNLESS clause or so. Let me elaborate with an example to understand why
this is a requirement. Let's consider that are two services or devices
which are connected as follows:

     A------B

Suppose the logical/physical connection between A or B goes down, metrics
collected from/for each end-point can potentially trigger an alarm. Metric
from A will generate an alarm with labels - local node is A and remote node
is B. Metric from B will generate an alarm with swapped values. Since the
underlying issue could be same, we don't want to generate both the alarms
because JIRA fails to de-dup such issues more often than not.


Thanks,
Dhiman

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-developers/CAB2OGjzJY8hHBUXWRsTqQ4EuDt4kFRSiordgfdS3BD1-S15-Tg%40mail.gmail.com.

Reply via email to