# Adding GCP Integration with a Backend on Another Cloud Provider

If your groundcover backend is installed on a cloud provider other than GCP, you can still add GCP integration by setting up a dedicated GCP cluster and configuring the sensor to run the GCP integration.

This setup allows you to monitor GCP resources and services even though your main groundcover backend is hosted elsewhere.

### Prerequisite

The below steps assume you have a GCP GKE cluster with groundcover sensor installed on it.

### Step 1: Create a Service Account

* Go to IAM & Admin in GCP Console
* Navigate to **IAM & Admin** → **Service Accounts**.
* Create a New Service Account
  * Click on **Create Service Account**.
  * Provide a **name** and **description** for the service account.
  * Click **Create & Continue**.
  * In the **Grant this service account access to the project** step, search for and select **Monitoring Viewer** (`roles/monitoring.viewer`).
  * Click **Continue** → **Done**.
* Grant the **roles/iam.workloadIdentityUser** role on the Google Cloud service account to the Kubernetes service account's identity.
  * Click on the newly created service account → **Permissions** → **View by Principals** → **Grant Access**
  * In the **Add principals** → **New principal** section enter "\[PROJECT\_ID].svc.id.goog\[\<groundcover sensor namespace>/integrations-agent]"
  * In the **Assign roles** → **Role** section choose **Workload Identity User**
  * Click **Save**

### Step 2: Configure GCP Integration

After installing the sensor, you'll need to manually configure it to enable GCP integration. This configuration tells the sensor to:

* Collect GCP-specific metrics and metadata
* Use GCP APIs to gather resource information
* Properly tag and label data with GCP-specific attributes

<pre class="language-yaml"><code class="lang-yaml">global:
  integrations:
    agent:
      enabled: true
integrationsAgent:
  serviceAccount:
    annotations:
<strong>      "iam.gke.io/gcp-service-account": "service account email created in step1"
</strong><strong>targets:
</strong><strong>  - Type: gcpmetrics
</strong>      name: &#x3C;provide a meaningful name for your integration>
      targetServiceAccount: &#x3C;provide the service account created in step 1>
      interval: 5m
      projectIds: &#x3C;list of project ID's>
      metricPrefixes: &#x3C;list of metric prefixes, e.g. compute.googleapis.com>
      extraLabels:
        environment: "prod" # optional
</code></pre>

### Verification

After 5 minutes, data collection should happen at least once and you could monitor your integration:

1. Navigate to the [Data Explorer page](https://app.groundcover.com/explore/data-explorer), search for the following metric `groundcover_data_sources_collected_entries_total.` The number of returned results should match the expected number of results.
2. Navigate to the [Traces page](https://app.groundcover.com/traces) and apply the following filter `source:groundcover-platform integration.name:<your integration name>`. The page will show the latest results of running the integration. In case of errors, open the trace to see more details.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.groundcover.com/integrations/data-sources/google-cloud-monitoring/adding-gcp-integration-with-a-backend-on-another-cloud-provider.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
