How to calculate uptime percentage using grafana singlestat and prometheus
00:20 25 May 2020

Currently I am calculating uptime % using below query.

But if I try to test by restarting a service that is if i restart at 12:00 and if i try to test at 12:05 it should show 100% availability , but in my case it is not showing that way.

Please help out with correct calculation for uptime %

Query which was used is

avg_over_time(up{instance="$instance", job!="jobid"}[${__range_s}s])*100

prometheus grafana metrics promql

prometheus grafana promql prometheus-node-exporter