> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/continuous-delivery/use-continuous-delivery/verify-deployments/configure-cv/health-sources/google-cloud-operations.md).

# Google Cloud Operations

Add Google Cloud Operations as a health source for Continuous Verification

This topic explains how to configure Google Cloud Operations (formerly Stackdriver) as a health source in Harness Continuous Verification (CV). Google Cloud Operations provides metrics and log data that Harness CV uses to verify deployment health.

***

## What you will learn from this topic

* How to [add Google Cloud Operations as a health source](#add-google-cloud-operations-as-a-health-source)
* How to configure [Cloud Metrics](#cloud-metrics) with dashboards or a manual query
* How to configure [Cloud Logs](#cloud-logs) with query mapping
* How to assign a [risk profile](#cloud-metrics) for Continuous Verification

***

## Before you begin

This topic assumes you have completed the prerequisite setup for Continuous Verification. Go to [Configure CV](/continuous-delivery/use-continuous-delivery/verify-deployments/configure-cv/verify-deployments.md) to complete those steps before adding a health source.

Confirm the following:

* **Google Cloud Operations connector**: Go to [Add Google Cloud Operations](https://developer.harness.io/docs/platform/connectors/monitoring-and-logging-systems/connect-to-monitoring-and-logging-systems#add-google-cloud-operations-formerly-stackdriver) to add the verification provider connector.
* **GCP dashboard** (Cloud Metrics path): Create a GCP dashboard before you import metrics into Harness, or plan to use **Manually input query**.

***

## Add Google Cloud Operations as a health source

This option is available only if you have configured the service and environment as fixed values.

A health source maps a Harness service to the service in a deployment environment monitored by an APM or logging tool.

Perform the following steps to add Google Cloud Operations as a health source:

1. In **Health Sources**, click **Add**. The **Add New Health Source** settings appear.

   ![Health Sources panel showing Add and the Add New Health Source dialog](https://3694223630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1JhZ4oKIppwY7d5AhPj%2Fuploads%2Fgit-blob-a656f7ec0473da5b4c038ef6466e47197e47e0bb%2Fverify-deployments-with-google-cloud-operations-124.png?alt=media)
2. In **Select health source type**, select **Google Cloud Operations**.
3. In **Health Source Name**, enter a name for the health source.
4. Under **Connect Health Source**, click **Select Connector**.
5. In **Connector** settings, choose an existing GCP connector or click **New Connector**.

   ![Connector settings showing existing GCP connectors and New Connector](https://3694223630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1JhZ4oKIppwY7d5AhPj%2Fuploads%2Fgit-blob-c962d479d6c7fc70277be58c053fbd102081d049%2Fverify-deployments-with-google-cloud-operations-125.png?alt=media)
6. Click **Apply Selected**. The connector is added to the health source.
7. (Optional) In **GCP Project ID**, select a project from the dropdown to query metrics or logs from a different project than the one configured in your connector. The dropdown auto-populates with all GCP projects that your connector's service account can access. You can also enter a custom project ID, but the connector must have access to that project; otherwise an error occurs when fetching data. Leave this field empty to use the connector's default project.
8. In **Select Feature**, select the feature to use.

   ![Select Feature options for Google Cloud Operations health source](https://3694223630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1JhZ4oKIppwY7d5AhPj%2Fuploads%2Fgit-blob-8fb01e0ef97c65aa3a2363ba1ed40ea0eeab854e%2Fverify-deployments-with-google-cloud-operations-126.png?alt=media)

***

## Cloud Metrics

Perform the following steps to configure Cloud Metrics:

1. Select **Cloud Metrics**, then click **Next**. The **Select Dashboard** settings appear.
2. Click one or more dashboards from the displayed results. If you do not have any pre-existing dashboards or do not want to select the ones in the displayed result, click **Manually input query**.

   ![Select Dashboard results with Manually input query option](https://3694223630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1JhZ4oKIppwY7d5AhPj%2Fuploads%2Fgit-blob-a67c06bc2a1fedff2142a9975b1490926900062d%2Fverify-deployments-with-google-cloud-operations-127.png?alt=media)
3. Click **Next**. The **Customize Health Source** settings appear.
4. Select a query from the options displayed on the left side of the settings panel. The specification of the selected query auto-populates in the fields under **Query Specifications**.

   ![Customize Health Source showing query list and Query Specifications](https://3694223630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1JhZ4oKIppwY7d5AhPj%2Fuploads%2Fgit-blob-fc9ef396d23602819fdae417154fdc305d71d664%2Fverify-deployments-with-google-cloud-operations-128.png?alt=media)
5. In **Configure Risk Profile**, select one of the following risk types in **Risk Category**:

   | Risk Type                 | Type of Values              | Deviation Type          | Default Delta | Default Ratio |
   | ------------------------- | --------------------------- | ----------------------- | ------------- | ------------- |
   | Error                     | Web / Business transactions | Higher is bad           | 0             | 0             |
   | Infrastructure            | Cpu, memory ....            | Higher and Lower is bad | 20            | 0.2           |
   | Performance/Other         | Cpu, memory ....            | Higher and Lower is bad | 20            | 0.2           |
   | Performance/Throughput    | Web / Business transactions | Lower is bad            | 20            | 0.2           |
   | Performance/Response time | Web / Business transactions | Higher is bad           | 20            | 0.2           |
6. In **Deviation Compared to Baseline**, select one of the options based on the selected risk type.
7. Click **Submit**. The health source is displayed in the AI Verify (v1) step.

***

## Cloud Logs

Select **Cloud Logs**, then click **Next**. The **Customize Health Source** settings appear.

You can customize the metrics to map the Harness service to the monitored environment in **Query Specifications and Mapping** settings.

Perform the following steps to map log queries:

1. Click **Map Queries to Harness Services**.
2. Enter a name for the query in **Name your Query**.
3. In **Query**, enter the query and click **Fetch Records**. The retrieved results appear in **Records**.
4. In **Identify Service Instance**, click the plus icon to select the path of the service instance.
5. In **Identify Message**, click the plus icon to select the message identifier.

![Customize Health Source for Cloud Logs with query mapping fields](https://3694223630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1JhZ4oKIppwY7d5AhPj%2Fuploads%2Fgit-blob-4830c4e820778ad07ca9cefbf86e858a72ba0516%2Fverify-deployments-with-google-cloud-operations-129.png?alt=media)

Click **Submit**. The health source is displayed in the AI Verify (v1) step.

You can add one or more health sources for each APM or logging provider.

***

## Troubleshooting

<details>

<summary>GCP Project ID dropdown is empty or fetch fails</summary>

Confirm that the connector's service account can list and read the target GCP project. If you enter a custom project ID, the connector must have access to that project.

</details>

<details>

<summary>No dashboards appear for Cloud Metrics</summary>

Create a dashboard in Google Cloud Operations, or click **Manually input query** to define the metric without importing a dashboard.

</details>

<details>

<summary>Fetch Records returns no log results</summary>

Verify the query syntax against your Google Cloud Operations logs, then confirm **Identify Service Instance** and **Identify Message** map to fields present in the returned records.

</details>

***

## Next steps

* [Configure CV](/continuous-delivery/use-continuous-delivery/verify-deployments/configure-cv/verify-deployments.md): Finish AI Verify (v1) step configuration after you add health sources.
* [Verification Overview](/continuous-delivery/use-continuous-delivery/verify-deployments/verify-deployments-with-the-verify-step.md): Review Continuous Verification strategies, sensitivity, and duration.
* [Add Google Cloud Operations](https://developer.harness.io/docs/platform/connectors/monitoring-and-logging-systems/connect-to-monitoring-and-logging-systems#add-google-cloud-operations-formerly-stackdriver): Create or update the Platform connector.

{% @harness-feedback/feedback %}
