I’m not sure if this is what you are looking for or not. But I contacted GCE support to see if I can know when GCE reboots one of my Instances.
I was able to do that using Stackdriver (for Free).
In Stackdriver Logging:
Then I created an alert from this user-defined metric in Stackdriver:
PRIVILEGED AND CONFIDENTIAL: This electronic message and any attachments are confidential property of the sender. The information is intended only for the use of the person to whom it was addressed. Any other interception, copying, accessing, or disclosure of this message is prohibited. The sender takes no responsibility for any unauthorized reliance on this message. If you have received this message in error, please immediately notify the sender and purge the message you received. Do not forward this message without permission.
From: 'Karthick (Cloud Platform Support)' via gce-discussion [mailto:gce-dis...@googlegroups.com]
Sent: Wednesday, October 18, 2017 3:25 PM
To: gce-discussion <gce-dis...@googlegroups.com>
Subject: [gce-discussion] Re: Health check log
EXTERNAL
--
© 2017 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-dis...@googlegroups.com) to participate in discussions with other members of
the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to the Google Groups "gce-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
gce-discussio...@googlegroups.com.
To post to this group, send email to
gce-dis...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/gce-discussion/36e3fb1b-3536-420f-baa6-de0b0f1e8140%40googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-discussion@googlegroups.com) to participate in discussions with other members of the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to the Google Groups "gce-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gce-discussion+unsubscribe@googlegroups.com.
To post to this group, send email to gce-discussion@googlegroups.com.
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-discussion@googlegroups.com) to participate in discussions with other members of the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to the Google Groups "gce-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gce-discussion+unsubscribe@googlegroups.com.
To post to this group, send email to gce-discussion@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gce-discussion/36e3fb1b-3536-420f-baa6-de0b0f1e8140%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
© 2017 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-discussion@googlegroups.com) to participate in discussions with other members of the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to a topic in the Google Groups "gce-discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gce-discussion/M8TmlQXmCkk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gce-discussion+unsubscribe@googlegroups.com.
To post to this group, send email to gce-discussion@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gce-discussion/SN2PR14MB0926746CA19DD3354541F22C9B420%40SN2PR14MB0926.namprd14.prod.outlook.com.
To post to this group, send email to gce-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gce-discussion/36e3fb1b-3536-420f-baa6-de0b0f1e8140%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
© 2017 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-discussion@googlegroups.com) to participate in discussions with other members of the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to a topic in the Google Groups "gce-discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gce-discussion/M8TmlQXmCkk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gce-discussion+unsubscribe@googlegroups.com.
To post to this group, send email to gce-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gce-discussion/SN2PR14MB0926746CA19DD3354541F22C9B420%40SN2PR14MB0926.namprd14.prod.outlook.com.
--
© 2017 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-discussion@googlegroups.com) to participate in discussions with other members of the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to a topic in the Google Groups "gce-discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gce-discussion/M8TmlQXmCkk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gce-discussion+unsubscribe@googlegroups.com.
To post to this group, send email to gce-discussion@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gce-discussion/741b958c-3759-4edb-90a6-a9114a05a4ec%40googlegroups.com.
Pavel,
Hello Karthick,The health check doesn't use any DB requests. It's just accessing UWSGI stats. It should be a very fast response.I can't include gcloud logging into this request due to the direct communication "health check->UWSGI".Here is our UWSGI stats config:[uwsgi]stats = :1717stats-http = truestats-min = truestats-no-cores = truestats-no-metrics = trueRegards,Pavel
To post to this group, send email to gce-discussion@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gce-discussion/36e3fb1b-3536-420f-baa6-de0b0f1e8140%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
© 2017 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-discussion@googlegroups.com) to participate in discussions with other members of the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to a topic in the Google Groups "gce-discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gce-discussion/M8TmlQXmCkk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gce-discussion+unsubscribe@googlegroups.com.
To post to this group, send email to gce-discussion@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gce-discussion/SN2PR14MB0926746CA19DD3354541F22C9B420%40SN2PR14MB0926.namprd14.prod.outlook.com.
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-dis...@googlegroups.com) to participate in discussions with other members of the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to the Google Groups "gce-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gce-discussio...@googlegroups.com.
To post to this group, send email to gce-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gce-discussion/36e3fb1b-3536-420f-baa6-de0b0f1e8140%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
© 2017 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-dis...@googlegroups.com) to participate in discussions with other members of the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to a topic in the Google Groups "gce-discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gce-discussion/M8TmlQXmCkk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gce-discussio...@googlegroups.com.
To post to this group, send email to gce-dis...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gce-discussion/SN2PR14MB0926746CA19DD3354541F22C9B420%40SN2PR14MB0926.namprd14.prod.outlook.com.
Email preferences: You received this email because you signed up for the Google Compute Engine Discussion Google Group (gce-dis...@googlegroups.com) to participate in discussions with other members of the Google Compute Engine community and the Google Compute Engine Team.
---
You received this message because you are subscribed to a topic in the Google Groups "gce-discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gce-discussion/M8TmlQXmCkk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gce-discussio...@googlegroups.com.
To post to this group, send email to gce-dis...@googlegroups.com.