Show visualization only when value is critical

Hi experts,

is there a way to display certain visualizations only when a certain value is passing a threshold?
I want to monitor a bunch of sensors, lets say 100 in one dashboard.
Even if I use colors to express critical values in e.g. red, it’s still not easy to gain an
overview, when there are, for example, 100 gauges in one dashboard.
I would be easier if I could display only the gauges that display a critical value.

Or is there maybe a visualization that I’m not aware of for such a case?

Thanks Christian

what is your datasource? why not exclude them at the datasource level via a filter

1 Like

My data is in ImflucDB V2.

Hmm, not exactly sure what you mean by a “filter”, but I have an idea.
But how would that help me? :thinking:
I would still have the visualization in Grafana and if I filter out the data, the visualization will show “No data”, but will be still there.
Or did I misunderstood you?

should we assume you meant influxdb? please share table structure if using influxql
or flux query/ please identify from your data what constitutes a critical value

I’m not 100% sure if I understood your questions correctly. I will try to answer in the best possible way.

Äh, yes, sure, sorry, it’s influxdb :hushed:

Here I’m not sure if I give the expected answer, but a line in my data would look something like this:
room_temp,device_id=eui-70b3d57ed006478e,host=SmartCity,topic=v3/ow-esp32-otaa@ttn/devices/eui-70b3d57ed006478e/up temperature=21.8

What I want to do is to monitor how many datapoints I have received in an hour. Since I know that the sensor is supposed to send a new value each 5 min, I should have 12 entries in the database per hour.
For that I’m using this InfluxQL query:
SELECT count("temperature") FROM "room_temp" WHERE ("device_id"::tag = 'eui-70b3d57ed006478e') GROUP BY time(60m)
It works (more or less, but that is another question, raised here: GROUP BY time - want to look backwards / handling timing deviations).
When I have received less than, let’s say 11 datapoints in an hour I would highlight that on the dashboard (= critical value).

1 Like

in other query languages you can do this

SELECT count("temperature") ,
  case
  when count(1) < 12 then 1
  else 0 end isMissing
 FROM "room_temp" 
WHERE ("device_id"::tag = 'eui-70b3d57ed006478e') 
GROUP BY time(60m)

look at the case statement. can you do that in influxql. please dont say I am not sure :smile:

or maybe you can use a transformation based way of checking the count of rows and usr it for showing red color

otherwise your question is not a grafana question but an influxsb question

You might want to explore using dynamic filters or conditional formatting in your dashboard tool the forbidden leggings. Many platforms allow you to set conditions so that only elements meeting specific criteria (like critical values) are displayed. This way, you can focus on the gauges that need attention without getting overwhelmed by all 100 at once.

And if that would be true ? Just asking … :grimacing:
But that is not an issue, with your advice I can did deeper and see if it possible.

I think it is infectious to misspell influxdb :sweat_smile:, anyhow, I guess you’re right. It touches the slight confusion with query languages in influxdb, SQL not here now (in the OSS version), Flux only limited in the future version (V3) ind InfluxQL missing some capabilities.

Anyhow, we drifted a bit a way from my starting question. Whatever the way is to identify a critical value - is there a way to show a visualization only when a critical value is reached?

1 Like

the previous recommendations I gave you has the answers. you have yet to try them out and see if they work

flimfluxdb :joy:

I feel your pain, that is why we moved away from influxdb

Maybe we haven’t completely understood each other :thinking:.
Taking your screenshot above (though in my mind 11 should be orange and 12, as the expected best value should be green). I don’t want to show the green (“everything is OK”) gauge at all. Only the orange and red gauges. So that I can see directly which sensors have issues without scanning and scrolling through the majority that is green and don’t need any attention. Imagine there are 100 of this gauges in one dashboard.

1 Like

Yeah, I followed that thread :face_with_raised_eyebrow:

Again, how do you define ok, soso, splendid “statuses” from the data you provided? just the count thing? 11, 12 ?

Hm, I feel that doesn’t matter for the basic question, if I can hide complete visualizations?
But anyhow, lets say every count < 11 (10, 9, …, 1, 0) should be NOT OK.
Maybe I can come up later with a more sophisticated criteria, but for now that should be good enough.

chrome-capture-2024-8-6

this is one way, in just one panel. same can be applied for the repeat option as well so you have distinct gauge panels

and here via repeat feature
chrome-capture-2024-8-6 (1)

:hushed:
Looks like exactly what I’m looking for!
But - I hope the question is not too stupid, seems to be obvious for you - how is that done?!
Looks like pure magic to me! :man_shrugging:

OK, cool, I guess I have some readings to do!
Thank you very much!

1 Like