You are adding different *metrics*?? Usually this is the wrong thing to do,
because different metrics have different meanings, and adding different
types of things generally makes no sense. This might mean you want a
single metric with more labels to distinguish them.
However in the case of sum by, you're in luck. The output of sum by is an
instance vector with no metric name, so you can combine them directly. For
example:
sum by (instance) (node_network_receive_bytes_total) + sum by (instance)
(node_network_transmit_bytes_total)
works just fine. Just make sure that the LH and RH have the same set of
labels, which in this case is just the (instance) label that has been
grouped on.
If you are desperate, there are ugly frigs to combine different metrics
directly, but I strongly discourage this sort of abuse:
sum by (instance)
({__name__=~"node_network_receive_bytes_total|node_network_transmit_bytes_total"})
label_replace(up, "__name__", "down","__name__","(.*)")
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" 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-users/2e545e42-326a-4d89-9396-6cc158fb0395%40googlegroups.com.