How to measure dips and peaks

  • What Grafana version and what operating system are you using?

    • OSS on Windows 11
    • Grafana 12.2
  • What are you trying to achieve?

    • I am running this query irate(node_network_transmit_bytes_total[1m])/(1024*1024/8) > 0.5 to see my network traffic and I am testing something that makes the traffic have these peaks and dips, I want the difference between the peak and dip each time this happens, maybe as a tooltip or as another panel

  • How are you trying to achieve it?

    • Failing to achieve this
  • What happened?

    • N/A
  • What did you expect to happen?

    • Have a tooltip feature that tells me one value that is the difference of the dips and peaks for each instance, or maybe another panel, but I just want to be able to decipher each value to each instance of dip and peak
  • Can you copy/paste the configuration(s) that you are having problems with?

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

  • Did you follow any online instructions? If so, what is the URL?

I have solved this by doing node_network_transmit_bytes_total - node_network_transmit_bytes_total offset 15. Putting offset and then a time interval, I did 15 seconds because I wanted the difference between each data point, gives you the value of that metric minus however much time you offset.

My queries looks something like this irate(node_network_transmit_bytes_total[1m]) -irate(node_network_transmit_bytes_total[1m] offset 15s

This graph shows me the difference in value between each point.

That looks like a job for the delta function

@jangaraj that’s what I tried to use at first but it wasn’t showing me the correct values. During the flat rate of my irate query, the difference should be 0 or near 0 since there is not much difference between the two points. And then only when it drops or climbs should there be a large value. This was successfully achieved by subtracting the current point from the last point using offset.

When I applied delta, delta(node_network_transmit_bytes_total[1m])/(1024*1024/8) > 0.5, the flat portion of my irate query is showing up with value greater than 0. Those values are around 400 plus or minus 10 so I think I may just have the values set wrong, where it is saying 400 it should say 0.

Either way, using offset achieved my goal.