GCP Metrics

Hosted Graphite provides a Google Cloud Platform add-on available in the Add-Ons page of your account. This add-on syncs the metrics from the specified GCP services into your account.

Contents

To connect to your GCP project, you need to provide the following information:

  • Service Account Key

In the main Google Console page select the 'IAM & Admin' panel. On the side panel navigate to the 'Service Account' link:

and create a Service account.

In the creation of the service account there are two roles that need to be added order for Hosted Graphite to pull these metrics into your account: 'monitoring.viewer' and 'computer.viewer' (if monitoring compute services).

Once the account has been created, in the Service Accounts page click on the account and create a key.

Ensure that the key type is JSON:

This will download a json file to you computer, which can then be uploaded to Hosted Graphite giving us permission to pull metrics from your GCP services.

The last thing you will need to do in your GCP account is to enable the Stackdriver API, which enables monitoring for your active GCP services:

To enable the GCP add-on, go to the add-ons page in your Hosted Graphite account and choose the option for GCP.

You will be presented with the following page; here you will be able to add, edit, and delete any GCP configurations. This page also provides options to add account names and tags.

The main GCP configuration page looks like the following:

Before saving make sure to include the resource to monitor by selecting the enable checkbox along with uploading the service account key. Tagging is also a feature that can be enabled. (Google refers to them as labels but they serve identical purposes). If 'Labels' checkbox is enabled then tagging will only be applied to that specific resource. If you don't want tagging to be enabled for a resource then leave it unselected.

More information on the available metrics can be viewed here. If you require a specific GCP service that is not listed, please don't hesitate to email us and we'll work swiftly to add it.

If you click GCP Labels you will be presented with the following screen which allows you to edit labels. Each label has a unique name (shown on the left) and one or more values. Values are separated by a comma.

Example: Entering “Tag_Next”: “hello, world” will configure the Add-On to only pull metrics from resources that have the label “Tag_Next” and at least one of the matching values of "hello" or "world" for that label.

If labels are not selected for any services, but labels are configured for the Add-On, it will act as if labeling is enabled for all services.

If you use multiple GCP auth keys on your Hosted Graphite account for different GCP projects, you can keep the metrics separated by assigning Account Names to your Client IDs.

Under the list of Client IDs on your HG account, there’s a button to access the Account Names interface. There you can assign names to your Client IDs, which will then become part of the metric name for all metrics retrieved using that ID.

The Google metrics for each service are mapped to Hosted Graphite metric names as follows:

gcp.{client_id}.{service}.{project_id}.{location/zone}.({label1}.{label2}...).{metric_name}

If AccountName is enabled then the client_id will be replaced by the account name provided. The labels are determined by the resource type and the metric, causing some metrics to have more than one label per metric. For more information regarding resource type label please refer to the GCP documentation.

This can be found and generated from within the Dashboard Library, and offers a great starting point for monitoring your Google Cloud services!

Go to the add-ons page in your Hosted Graphite account, and choose the option for GCP.

Click the Delete button and the GCP add-on will be disabled for that account.

While we attempt to minimize the number of API calls that may incur Google Cloud Platform charges, Hosted Graphite disclaims responsibility for potential costs incurred by the use of this add-on. For more information please review GCP's API cost and rate-limiting information.

Our add-on performs read-only requests to the Google Cloud API. Should the provided GCP Service Account Key grant greater privileges than what is specified in Roles, responsibility for any activity performed using those keys lies with the customer.

Last updated