A way to display total time between state changes

  • What Grafana version and what operating system are you using? Using grafana on Chrome on Windows PC

  • What are you trying to achieve? Hi, I’m new to Grafana. I’m using OSIsoft-PI as data source. My data values range from -1 to 5. I would like to calculate the total time the values are >1 and display the total for a given period of time, day, month as a stat panel.

  • How are you trying to achieve it? Trying to filter values greater than 1 and counting the time they are on. Then add all the time together to display on the stat panel. On the other hand I also have a state timeline with the same data source and the tooltip shows the exact duration it was <1.This is what I want but unable to do on a stat panel to show a total time(see below) Is there any way to extract info from the tooltip throughout the day and display a total in a stat panel?

  • What happened?

  • What did you expect to happen?

  • Can you copy/paste the configuration(s) that you are having problems with? No

  • 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?

Welcome @avinashsrinivas to the Grafana forum.

What query language does the above use? Can you provide us with the text of your query or a screenshot?

Can you show using screenshots how you tried adding the time for all values > 1?

Not that I am aware of.