> For the complete documentation index, see [llms.txt](https://docs.pagerly.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pagerly.io/sre-ai-agent/data-sources/gcp.md).

# Google Cloud (GCP)

## What the Agent Can Do

* List GCE VM instances — status, machine type, zone
* List GKE clusters — status, version, node count, location
* Query Cloud Monitoring metrics using metric type filters
* List recent GCE operations — find infrastructure changes

## Setup Instructions

1. Go to **Google Cloud Console** > **IAM** > **Service Accounts**
2. Create a service account (e.g., `pagerly-sre`)
3. Grant roles: **Compute Viewer**, **Kubernetes Engine Viewer**, **Monitoring Viewer**
4. Generate a key (JSON) or use Workload Identity
5. Use `gcloud auth print-access-token` to get an OAuth token
6. Enter the access token and project ID in the Pagerly dashboard

## Required Credentials

| Field                  | Description                  | Example              |
| ---------------------- | ---------------------------- | -------------------- |
| **OAuth Access Token** | GCP OAuth access token       | `ya29.a0...`         |
| **Project ID**         | Your Google Cloud project ID | `my-gcp-project-123` |

{% hint style="warning" %}
**OAuth tokens expire.** For long-term access, consider setting up a service account with a refresh token or using Workload Identity Federation.
{% endhint %}

## Context Prompt Tips

> *"Our GKE cluster is prod-cluster in us-central1. Key VMs are prefixed with api-. Cloud SQL instance is prod-db."*

## Docs

* [Google Cloud APIs Overview](https://cloud.google.com/apis/docs/overview)
