Uptime in GCP: Measure the % uptime where site is available from _any_ location

558 Views Asked by At

Our site is running on Google App Engine, and we've set up monitoring and uptime alerts.

We want to be able to report on site uptime as a %, where the site is consider up if it can be accessed from any of the 6 locations:

  • If location A cannot access the site, but locations B, C, D, E and F can. The site is up.
  • If locations A, B, C, D and E cannot access the site, but location F can. The site is up.
  • If locations A, B, C, D, E and F cannot access the site. The site is down.

Currently the % calculation is: (1 - Total number of failed checks) / (Total number of checks). This unfortunately means that the uptime is affected by a single location being unable to access the site.

Is it possible to get the uptime calculation we're after?

1

There are 1 best solutions below

1
On BEST ANSWER

You can create an uptime chart for that.
If you group data by app, and set aggregator to fraction true, then graph will reach zero only when all of the uptime checks fail.
Query will look something like that (this is for VM instance):

fetch gce_instance
| metric 'monitoring.googleapis.com/uptime_check/check_passed'
| filter (metric.check_id == 'uptime-1')
| group_by 1m, [value_check_passed_count_true: count_true(value.check_passed)]
| every 1m