Google Cloud Operations suite is a bundle of tools to monitor, troubleshoot, and enhance the performance of your cloud infrastructure or applications deployed on the cloud infrastructure, previously it’s called as “Stack driver”
Cloud Monitoring provides end-to-end monitoring solutions, you can choose to use it for free or pay for it if you want no limits on the uptime-check configurations, The cost will depend on your usage, you can check these details on official pricing page to explore more about its cost , While there are several configuration options and advanced monitoring capabilities that you get with Google’s Cloud monitoring tools, here, we focus on monitoring websites uptime and latency.
If you are completely new to GCP Operation Suite, please refer this blog on Cloud Monitoring and Cloud Logging
Getting Started with Google Cloud Monitoring
Now, all you have to do is, log in to the Google Cloud Monitoring console, then head to the sidebar and click on “Uptime checks.”, next you have to do configurations for uptime check.
Configuring Uptime Checks
You need to follow through four steps to add an uptime check for your website successfully, here Iam configuring uptime check for a website hosted on App Engine
Now in the Uptime check section, click on “CREATE UPTIME CHECK” to get started.
Then in step -2 you have to add a name to your configuration and then give the target information to specify what you want to monitor.
As mentioned, here we are focusing on a web based application. So I am opting for resource type HTTPS protocol with the page URL as the hostname.
For this I gave link of a service hosted on my Google App Engine without specifying a path, but if you want to configure uptime checks for a specific directory or a subpage, you can simply do it by entering the path for it in the Path column provided.
And from Check Frequency, it also allows you to set the frequency for the uptime check, 1 minute is the default and the fastest available, you can choose from 1–15-minute time intervals, below are some more target options where you can further configure for Request Method, port number, Custom header validation give Authentication details.
Configure Response Validation
Next in Step-3, you can set a custom response timeout for the request to wait and check whether if the website is up and running or not.
Enable content matching as shown above, to check for availability of any specific content just by selecting the Response Content match type and giving the expected response content.
As of now all the configuration to create an uptime check has been configured, Now move on to the next step to create an alert and select a notification service whenever a failure is detected.
Create Monitoring Alert & Notification Channel
To get notification in case of a failure you have to set up alerts along with a notification channel that you want to receive updates on, here you have to specify a name and select the duration of notifications between 1 minute to 23 hours 30 minutes.
If you don’t have an already created notification channel, go to the notification channel manager page separately and explore all the options available and create the notification channels as needed, you will have a variety of options like email, Slack, Google Cloud Mobile App, Webhooks, SMS.
Once you are done with creating a notification channel, then select the notification channels that you want to get alert on and to complete the uptime check configuration.
Please test it to see if you have done your configurations right, if all the configuration is good, you will receive a message as “Responded with 200 (OK)”, along with a green tick.
And then go ahead to add the configuration by clicking on CREATE, soon you can see status of your service from all the regions.
This blog is written by Checkmate Global Technologies DevOps Engineer, You can please reach out to him for any Cloud Infrastructure related discussions.