## About

Cavisson's GCP integration allows you to monitor your GCP environment by collecting a host of data points for different GCP components. GCP provides infrastructure as a service, platform as a service, and serverless computing.

## Pre-Requisites

Before beginning with the configuration of GCP monitors, make sure that you have the following details ready:

- You should have a service account file of your GCP account. To create one, follow the instructions provided in the following link:
  https://cloud.google.com/iam/docs/creating-managing-service-account-keys
- The clientID passed in the service account file should have viewer access for retrieving metric data from different GCP services/components. Check how you can grant the viewer role via the following link:
  https://cloud.google.com/asset-inventory/docs/configuring-permissions
- In order to apply the supported monitors, the corresponding services/components should be created & enabled in your GCP account. For e.g. in order to get DataFlow metric data, you need to ensure DataFlow is active on your GCP account.

## Configuration

1. Enable the GCP integration in the monitor UI by entering the below information:
   - Upload Service Account File - As mentioned in the pre-requisites, upload Service account file which contains Project ID, Client ID, Token URI, Private key as well as Auth uri

Once you have uploaded the Service Account File, go to the Monitor(s) section and select the different GCP components that you want to monitor. After selecting the required components, get back to the configuration page and click on the Add button to start monitoring your GCP application.

#### Download/Delete Added Accounts File:

- Once you have Uploaded the service account(s) file, you can download the json file by clicking on the download icon under the Actions column. To delete the service account file, click on the Delete icon.

#### Validation

- To validate the successful implementation of GCP monitoring check the Monitors homepage where you will be able to see a dedicated section for the newly configured GCP monitors with details on running and failed monitors.
- Validate the GCP metrics under the given Project Id in the metrics tree.

#### Troubleshooting

- Service accounts should have the proper permission.
- Services should be created properly.
- Services API should be enabled.
- Stackdriver Monitoring API should be enabled.