0

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

1 Answers1

0

the issue with how you try and calculate it is that when a service is down up does not have a value.

you can look at this solution How to get overall uptime of a server with prometheus and node_exporter

Raven
  • 713
  • 2
  • 10
  • 21