#Hi All
1 messages · Page 1 of 1 (latest)
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
what is the usage of "on"
https://prometheus.io/docs/prometheus/latest/querying/operators/#vector-matching on allows for matching between series with different label sets
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?
nic_util_percent is calculated in the Nic plugin for this template https://github.com/NetApp/harvest/blob/main/conf/zapiperf/cdot/9.8.0/nic_common.yaml SVM is not in the metric because ONTAP does not aggregate these at the svm level. In other words, ONTAP doesn't return any SVM related information so Harvest can't include it
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
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
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
It works!!!
Is this the same metrics?
lif_recv_data{svm="Cluster"} * 0 + on (datacenter, cluster, node, port) group_left label_replace(nic_util_percent, "port", "$1", "nic", "(.*)")