Is it possible to create log based metrics in Google Cloud for missing data?

Viewed 73

I'm trying to create a log based metric in Google Cloud that alerts when a certain log entry is no longer written to the logs. Write now my application writes "Im alive" to the log every 30mins. I'd like to create an alert that will alert if there is no "Im alive" written to the log after 45mins.

The idea is to be able to alert if an application which reads off a queue stops reading.

I am able to easily create an alert that alerts every time a log entry appear, but I would like to alert on the absence of a log entry.

2 Answers

You can use your logs metrics and alert when the count of entries is below 1 over 30 minutes.

Cloud Monitoring can do that

This is illogical. Make it log "stopped reading" and log why it stopped reading.
There also would be uptime checks, in case this should be is web-based.

Related