How to indicate that a there has been no data for x amount of time?

Hi, I have time series data of temperatures from x10 different sensors, and am displaying the “current” value using a Bar Gauge.

The sensors should get a new value roughly every hour, but I would like some way to show if the sensor has failed (e.g. hasn’t had any data for let’s say 1 day). The problem is that data is always being displayed, no matter how old it is (as expected, because I am selecting LAST):

I have tried to use a WHERE time>now() - “some time” clause in InfluxDB, but now the relevant values have been removed entirely:

What would be a good way to fix this? (ideally whilst still taking advantage of the GROUP_BY feature that I’m using, which is nice)

Idea (so you need to play and develop it): create A query which doesn’t have timefilter - that will have all timeseries - all rooms, value doesn’t matter.
Create query B with time filter e. g. last hour
Use tranformations on the Grafana level:

  • join A with B by room name
  • organize - hide unwanted columns

Use only B value in the final result, you can replace text no data with Not available for last hour - it depends if this option is available in used panel type.

@jangaraj I will need a little more help I’m afraid, if you don’t mind. I have tried creating a new query with time filter as you suggest, like this?

Then transformation?

Doesn’t work yet…

How one should understand what doesn’t work? As I said that’s idea. Play, try, improve it until you have desired result. Don’t try to achieve everything in one go. Step by step. First you need data in right format, so don’t focus on visualization - just use table panel, where you will have room and value/no data.

@jangaraj When you recommend “create A query which doesn’t have timefilter”, do you mean something like this: SELECT "temperature" FROM "RHTsensors" ?

Because this would retrieve every value from the measurement, which would be very inefficient?

If you could be kind enough to offer more advice that would be great.

Not every value (metric value), but every tag value (all friendly names).

Yes, it will be inefficient, but you have user on other side with requirement “I WANT this”. So it’s up to you what do you prioritise when used query language doesn’t support it directly. You can also hardcode that list, but that also has pros and cos. You need to decide what you can accept and what is not acceptable.

I can query the tag values, and that does indeed give me the correct list:

show tag values from RHTsensors with key = "friendly_name"

name: RHTsensors
key           value
---           -----
friendly_name RHT Sensor (Fridge)
friendly_name RHT Sensor (Kitchen)
friendly_name RHT Sensor (Lounge)
friendly_name RHT Sensor (Main Bathroom)
friendly_name RHT Sensor (Main Bedroom)
friendly_name RHT Sensor (Outside)
friendly_name RHT Sensor (Small Bedroom)
friendly_name RHT Sensor (Summer House)
friendly_name RHT Sensor (Top Bedroom)
friendly_name RHT Sensor (Top Office)

Is this what you mean? if so, what to do next with this list?

But this is not timeseries. This is format which can be used for dashboard variables only. Transformation needs time series.

So how do you create a series “which doesn’t have timefilter” but which at the same time also has “Not every value (metric value)” ?

I don’t know. I gave you the idea only based on my professional experience. Please don’t expect from me that I spent hours just to develop solution to fix your problem for free. It is opinionated idea and you may find that’s non sense idea. Then you should to find better solution for you.

I do not know why you say “for free”. The whole point of these community forums is that people provide solutions for each other if they are able to. In this case, you were not able to.

Ofcourse I don’t expect you to spend hours on my problem.

I do expect that you can elaborate on any suggestions you make, if the person you are trying to help finds them unclear.

Sorry, I’m not able to provide a solution. I gave you only idea. You need to figure out if it is correct or not. Evantually wait for someone who will provide better idea or solution.

@jangaraj Having a hardcoded list is acceptable to me. How would I do it in that case?