I have 2 queries:
rPDU2PhasePower{rPDU2PhasePowerIndex="1"} / 10
and
rPDU2PhasePower{rPDU2PhasePowerIndex="2"} / 10
I want to combine the results of each query into one that has the combined usage on both phases.
The queries are named “Usage1” and “Usage2”, the following expression does not work:
$Usage1 + $Usage2
I can change it to:
$Usage1 + $Usage1
and it results in 2x usage1, but it doesn’t seem to work if I combine both.
yosiasz
December 15, 2023, 4:30am
2
Welcome @desultory
What does “does not work” look like?
it produces no output. I can try to refresh the panel and toggle the expression and it doesn’t appear on the graph.
yosiasz
December 15, 2023, 5:00am
4
what do you see when you try them each separately one by one
$Usage1
first by itself
then $Usage2
by itself
I can see them one at a time. There seem to be no results when they are combined.
1 Like
yosiasz
December 15, 2023, 5:10pm
6
So are they both series of data or they each contain a single value?
Both are time series data, I have tried using instant on either, but nothing seems to work.
Maybe I can do something in prometheus to make a new metric that is the combined value of both of those?
yosiasz
December 15, 2023, 8:42pm
8
That Math is for math as in 5+5=10 type of thing.
What you might be looking for is the join transformation
Am I able to make alert conditions based on transformed data?
yosiasz
December 15, 2023, 9:14pm
10
Is this question related to your original question?
Yes, sorry I was not clear in the original post.
My end goal is to add the power usage from both (or all) phases, and then alert based on that condition.
I able to use a transformation, and it gives me the total usage for ALL devices, but I can’t seem to alert on that.
I’m probably missing the method to show usage for EACH device combined, but I’d also like to alert on combined usage, and that doesn’t seem to be an option: