#Hi All

1 messages · Page 1 of 1 (latest)

lean crypt
#

hi @torn mauve not sure it makes sense to combine those two metrics together since they have different units. lif_recv_data is bytes per second while nic_util_percent is unit-less.

If you still want to add them together, I think, something like this should work. lif_recv_data + on(datacenter,cluster,node,port) group_left label_replace(nic_util_percent, "port", "$1", "nic", "(.*)")
The reason the label_replace is required is because lif_recv_data uses the label port while nic_util_percent uses the label nic. Since the labels are different, there will be no matches for the addition operator. We can use label_replace to change nic_util_percent's nic with port and then the two vectors will match

lean crypt
torn mauve
#

Hi Chris, I am not so familiar with the prometheus metrics,
But the metrics seems doesn't work
I cannot get the nic_util_percent value on the cluster svm
Can I assign the svm value as "Cluster" in lif_recv_data?

lean crypt
torn mauve
#

Yes, so my first step is to use this metrics
lif_recv_data{svm="Cluster"}
so that I can know which ports should I focus on and then find the assigned nic_usage in nic_util_percent
And merge the two tables

lean crypt
#

thanks for the clarification - I know realize your original question was not about adding (addition) but adding as including. Typically we would use an on with a group_left or group_right join, but in this case, I don't see a label to join with. Labels are needed so the arithmetic binary operator * multiples by 1, instead of a using the result of the multiplication. Could you create a GitHub issue with this request? @dreamy warren may know another way to do the join without labels. I'll take another look when I get a chance

lean crypt
#

does this work for you? sum without(nic) (label_replace(nic_util_percent, "port", "$1", "nic", "(.*)")) + on (datacenter, cluster, node, port) group_right lif_recv_data{svm="Cluster"} * 0

torn mauve