Google Cloud Platform contains several products for keeping track of your apps and alerting when things go south. In this article I will link a couple of products together to use this built-in alerting functionality in your own application.
In order to send alerts, we need monitoring. To monitor we need metrics. The metrics we need will come from logs. The Cloud Logging and Monitoring components of GCP were formerly know as Stackdriver. They rebranded it to Google Cloud Operation’s suite.
When opening Cloud Monitoring, you will see a couple of default dashboards already available depending on what products you already use. GCP monitors the state of the components in your project such as the Compute Instances, Load Balancers, GKE clusters, Cloud SQL instances…
Some time ago, I created a container to run Laravel apps on Google Cloud Run. This harnessed the scalable power and ease of setup that comes with a serverless solution. The result was a responsive and cost effective service. Cloud Run spins new container instances up as needed, and down when there’s no traffic. Even all the way down to zero when your app has no visitors. Pay-as-you-use to the nearest 100 millisecond!