Increase and Decrease per day


I have a metric which shows the number of available servers.
I want to have two counters for booted and halted servers a day. Should be the sum of all increases of this metric and the sum of all decreases.

Something like:
booted today: 370
halted today: 120

Some clever ideas?

At least delta() gives me the changes, with a a transform “Filter data by values” >0 i can see all increases…

What is your data source, and what have you tried so far? Can you paste it here so others can evaluate it?

Data Source is Thanos. QL is promql.

My query looks like this so far: