Assuming you are monitoring your servers via something like the Node
Exporter, and you want the trailing 30-day upness percentage, you could use
the Node Exporters "up" metric like this:
avg_over_time(up{job="node"}[30d]) * 100
This is assuming that the scrape interval is not changing over those 30d,
as otherwise you would be weighting some periods (the ones with a higher
scrape frequency) more than others.
On Fri, Feb 17, 2023 at 5:25 AM sri L <[email protected]> wrote:
> Hi all,
>
> I am looking for server uptime percentage metrics on a monthly basis
> Example: If server is down for 60hrs out of 720hrs of a month the uptime
> has to show 91.66% in dashboard
>
> Please suggest if you have a relevant expression to serve this purpose
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/e34b891c-a5ea-43c8-b567-83588354f831n%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/e34b891c-a5ea-43c8-b567-83588354f831n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
Julius Volz
PromLabs - promlabs.com
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/CAObpH5yQLYm-o-WCucJSB9i2vO2Ah2Br7fKdc8hbbd2vTC2qUg%40mail.gmail.com.