Hi,
To show the status of a connection , I use “http response” plugin.
I use a “Stat” visualisation in my Grafana dashboard to display the status with a color and an associated text
This is my flux request:
from(bucket: "HOME")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "http_response")
|> filter(fn: (r) => r["_field"] == "http_response_code" or r["_field"] == "result_code")
|> filter(fn: (r) => r["_value"] != 0)
|> group()
|> last()
|> yield(name: "http_response_result")
So if result_code is 0 (connection ok) i display the http_response_code like 200, 401, …
If result_code is different from 0, I display the result_code like 3, 4 (time out)
so for:
3 i display “connection_failed” with red background
4 i display “time out” with red background
200 i display “success” with green background
401 i display “Unauthorized” with orange background
…
But my problem is if I stop “telegraf” on the computer , i was in the case that the value displayed is the last value received.
But what i would like it’s since a certain time that there is no new value, I would like to display something like “No Data” , how can i do that ?
And i just begin with Grafana + Telegraf + influxdata, so is it the best practice to do what i want like that ?