It's crazy how simple it is to set this up within GCP. You can even do this with your internally hosted CM servers (assuming you don't mind log shipping to your super secure private cloud)! In a previous post I installed Stackdriver on my VM and showed how the logs appear within the UI.
I dare say a majority of the times CM breaks an error entry is generated within the application log. Stackdriver is sending me those entries. As shown below, here's an entry from CM stemming from me having (purposefully) moved a document store.
Similar entries will be generated when the database goes down, document stores are full, and when IIS resets on me. More importantly, it's super easy to push TRIMWorkgroup log file entries into the event logs. Also, many integrations can have their log4net logging mechanisms redirected to the event logs!!!!
From the logging interface I can select Logs-Based metrics on the left and then click Create Metric...
Next I gave it an easy to understand name and a set of filters that drill down to just the errors from the workgroup service. More advanced filters can be defined so that more (or less) is included. This serves my purposes for now.
After hitting save, I can select Create Alert from Metric....
Here I just need to provide an interval which would trigger the alert...
Once that's saved I can configure one or more notifications. Here I'm sending an email, but options exist for text, slack channel post, or smoke signal. Pretty slick.
After it was all saved I went and triggered an error by trying to open one of those missing documents. Look what I got via email about a minute later!
Time to start cranking out preset filters for customers!