Calculate the daily uptime as a percentage for the last 30 days

Hi, I’m relatively new here and I’m trying to come up with a solution to my problem. Unfortunately, unsuccessfully.

I have Telegraf installed and the ping input plugin tests the availability of the website every 2 minutes. In Grafana I want to do something like a histogram (probably using a bar gauge) that will show the percentage success of a ping in one day, in an overall graph in 30 days.

Ie. the graph will be displayed for the last 30 days, each column (bar) will be 1 day (00:00:00 - 00:00:00) and each column (bar) will show the percentage of uptime depending on the ping (on that day). If all pings on a given day are successful, the bar will show 100%

I tried to find the answer on Google, even here on the forum, but when I found something, it was a “SQL” syntax. I use flux language.

Thank you in advance