Search code examples
google-cloud-platformgoogle-compute-enginestackdrivergoogle-cloud-monitoringgoogle-cloud-stackdriver

How do I check the uptime of a GCE instance using Stackdriver?


What options do I have to check the uptime of a GCE instance ?

  1. Do I need to install a monitoring agent , in the documentation for monitoring though it only mentions about uptime check of an Apache server insatalled on the GCE instance , how can I check if the GCE instance itself is up or not if it does not have a webserver on it ?

Solution

  • There are a few options.

    If you are running some service on the instance, you probably want Stackdriver Uptime Checks, which will verify that your service is available and serving traffic. If you simply want to know if the instance is up (i.e., not stopped), you can use the compute.googleapis.com/instance/uptime metric. Neither of those two options needs the monitoring agent installed.

    If you are trying to check that the instance is actually up and running processes, then you'll likely want the monitoring agent. Even in that case, there are a few possibilities. The agent monitors its own uptime via the agent.googleapis.com/agent/uptime metric, or you could monitor for the presence of a specific process via the processes metrics.