> For the complete documentation index, see [llms.txt](https://docs.groundcover.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.groundcover.com/integrations/data-sources/google-cloud-monitoring/adding-gcp-integration-with-a-backend-on-another-cloud-provider.md).

# 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** and **Service Account Token Creator**
  * 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

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

### 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` 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>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
