-
What Grafana version and what operating system are you using?
9.4.3 running in some flavor of Linux -
What are you trying to achieve?
I am trying to create a dashboard with a State Timeline that condenses a large number of “alarm levels” down into a single maximum alarm level for each of my stations. This is going to be used in an overall “system status” dashboard to tell me, at a glance, if each station is completely normal, if it has minor alarms, major alarms, critical alarms, or if its communications are off-line. -
How are you trying to achieve it?
Inside of InfluxDB, I have a task that looks at a large number of alarm points and processes them down into a smaller list of “what’s actually wrong” at each substation. Basically, I am applying 20+ years of knowledge from looking at our SCADA system to look at certain combinations of alarms and values and come up with more functional alarm points for our operations guys to look at. These processed alarm levels (consisting of 0=normal, 1=minor alarm, 2=major alarm, 3=critical alarm, and 5=comms off-line) are being written into a separate bucket from my original data, with each station having its own _measurement value and then each alarm point having its own _field of CS (for current state) and _value of 0-5. I have gotten so far as to come up with the following Flux query to get all of my data into one manageable block:
from(bucket: "SCADA_Processed")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_field"] == "CS")
|> aggregateWindow(every: 5m, fn: last, createEmpty: false)
|> pivot(rowKey: ["_time", "_measurement"], columnKey: ["point_id"], valueColumn: "_value")
|> yield(name: "last")
This gives me a nice table with one row every five minutes and all of my alarm values in columns. What I need now is to condense all of the fields in each row into the maximum value of all the columns in that row so that I can display that value in my state timeline for each station. I can’t figure out a Flux query or a Grafana transform to do this, but I’m figuring that there has to be a way. I’m basically trying to create a summary metric showing the worst case of everything at each station and then graph it in a state timeline.
- What happened?
If I run this query in InfluxDB Data Explorer, I get a table like this:
In my Grafana dashboard editor, when editing my state timeline panel, I get various unreadable jumbles of all my points on separate lines, a graph reduced to a single value, or nothing at all, depending on what transformer I try. I’m just not finding the right combination of query and transforms to give me what I’m after.
- What did you expect to happen?
I want to get to where I have a state timeline panel with each station (_measurement) on line and the worst-case alarm value from all of the alarm points in that station graphed over time.