Google Cloud Platform Provides Metrics via Monitoring API

Google Cloud Platform has released the Cloud Monitoring API, which enables users to monitor various metrics for Cloud Platform projects. The initial set of metrics supported in this release includes monitoring data such as response times, disk usage and uptime.

The API can be used to query current and historical metrics for up to 30 days, according to a Google blog post. Each of the metrics is measured every minute and stored as data points over time. Metrics are available for three platform services for now: Google Compute Engine, Google Cloud SQL and Google Cloud Pub/Sub.

As an example of rich metrics data available for Compute Engine (a total of 13 metrics), users can get the following information: delta count of incoming bytes/packets dropped by firewall; delta count of disk read/write I/O operations; bytes written to disk; and virtual machine running time. Check out the full list of supported metrics.

Users can enable the Cloud Monitoring API for projects via the Google Cloud Console, a standard way to enable APIs for Cloud Platform projects. Once the API is enabled, users need to enable client ID, and the authentication will be done via OAuth 2.0. Alternately, users can also use a service account to access the API.

If you are looking at building a web-based dashboard, you can follow a sample GitHub project made available by Google that builds a custom dashboard that accesses the Cloud Monitoring API via the Google APIs JavaScript client library.

The Cloud Monitoring API is sure to kick-start integration of these metrics in not just monitoring tools from vendors but homegrown dashboards built by developers to monitor the health of their Cloud Platform projects. The API can play a key role in understanding the costs associated with the project and integrating custom alerts that are driven by the metrics.

Check out the Getting Started page to start using the Cloud Monitoring API. The full API reference is available here.

About the author:Romin Irani
Romin loves learning about new technologies and teaching it to others. His passion is to help developers succeed.