Google Cloud Platform is a platform that allows users to create and manage clouds of servers, applications, and data. The platform is used by businesses of all sizes to run their business operations. One of the most important aspects of running a business on Google Cloud Platform is monitoring the health of your instances. This article will provide you with some tips on how to do this.

  1. Use Google Cloud Platform Console to Monitor Your Instances The first step in monitoring your Google Cloud Platform instances is using the Google Cloud Platform Console. This tool allows you to view information about your instances, applications, and data. You can also manage your instances and applications using this tool.
  2. Use the gcloud command-line tools for Monitoring Your Instances Another way to monitor your Google Cloud Platform instances is through the use of the gcloud command-line tools. These tools allow you to view information about your instance, application, and data in a more comprehensive way than using the console or gcloud commands alone.
  3. Use Data Sources for Monitoring Your Instances and Applications Another way to monitor your Google Cloud Platform instances and applications is through data sources. Data sources allow you to collect data about specific objects or entities within your environment. This can help you understand how your instance or application behaves under specific conditions or when certain events occur.

Google Cloud Platform comes with a suite of monitoring tools that track metrics on any cloud resource you’re using, which can help you spot problems in your infrastructure. On top of that, it features full support for AWS as well.

Setting Up A Monitoring Dashboard

By default, GCP creates dashboard for some major resources, such as Cloud Storage buckets, storage disks, and Compute Engine instances, which are viewable from the “Monitoring” tabs of those resources. However, the full “Monitoring” service is available from the sidebar, under “Operations”:

You can view the existing dashboards under the “Dashboards” tab:

By default, the graph for Compute Engine instances shows CPU utilization, Disk I/O, and any alarms that have gone off recently. You can filter all of these graphs by time and date using the controls at the top.

If you want to create your own dashboard though, it’s pretty easy. Dashboards are generic—you can create a dashboard that can apply to any GCE Instance and then filter the dashboard by instance name, project ID, or zone ID. This way, you can configure one dashboard with all the useful metrics,  then reuse it for any resource of the same type. If you do want the dashboard to show a specific instance, that’s possible as well.

From the “Dashboards Panel,” create a new dashboard:

Each Dashboard holds multiple charts, which show metrics from a given resource. Create a new chart to add to the dashboard:

From this dialog, you have total control over what metrics you want to display. You’re not limited to just one metric, as charts can display multiple metrics on top of each other, though it’s not guaranteed that the two graphs will make sense together.

Resource Type allows you to select what kind of cloud resource you’re monitoring, whether that’s a Cloud Storage bucket, Database, Compute Engine or EC2 instance, or pretty much any GCP or AWS resource you can think of. This will filter which metrics you can use to only show metrics that apply to the given resource.

The Metric name will select which data to show on the graph. There are a lot of metrics for complex resources like GCE instances, but the common ones like CPU Utilization, Disk I/O, memory usage, and Network In/Out are all here.

Filter allows you to preselect a particular project, instance, zone, or group. You can always change this from the dashboard to view other instances, but this will set the default filter.

Group By will change how multiple resources are displayed on the graph. If you’re adding a chart to monitor a group of instances, you could, for example, choose to separate them by Instance name.

Once added to the graph, you can always edit the settings from the menu on the chart, or activate “Stats Mode”, which will display moving averages and other useful features.

Setting Custom Alarms

One of the most useful features of GCP’s Monitoring suite is being able to set custom alarms that will notify you whenever there are problems with your network.

There are two kinds of alarms offered by Monitoring, both of which are entirely free and unlimited for everyone. Uptime Checks will query a web or TCP service to ensure that it’s still up and running. Alerting Policies will monitor metrics, and send alerts whenever it reaches a certain level, or something out of the ordinary happens.

Uptime checks are simple, and available from the main “Overview” tab. You’ll simply have to give it your hostname, and set an interval for it to check.

Once you hit “Save,” it will prompt you to create an Alert Policy for the check, which will send you notifications if it ever fails.

If you want to set up your own Alerting Policy, you can do so from the “Alerting” sidebar. This allows you to select a resource, metric, filter, and group, and configure it to send a notification if the graph meets the given condition. For example, you could set an alarm to trigger if CPU utilization on the instance is over 80% for at least a few minutes.

Of course, you’ll need to configure notifications for the alarm. The simplest option is to set up a notification channel to send you an email, but other options are available, such as SMS notifications, Slack notifications, or posting to a webhook.

All of these notification options are entirely free.