> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xpander.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Cloud Monitoring

> Learn how to integrate AI agents with Google Cloud Monitoring using xpander.ai. Create intelligent AI agents that can automatically track metrics, respond to alerts, and take action on real-time performance and system health insights across your cloud infrastructure.

## About Google Cloud Monitoring

**Google Cloud Monitoring** is a fully managed observability and monitoring platform offered by Google Cloud.

Key features include:

* **Comprehensive Metrics Collection**: Collects metrics from Google Cloud services, virtual machines, containers, databases, and custom applications to provide deep visibility into system performance and health.

* **Real-Time Alerting**: Create and manage alerting policies based on metrics, thresholds, and logs to detect and respond to incidents proactively.

* **Uptime Monitoring**: Monitor the availability and responsiveness of applications and endpoints from multiple global locations.

* **Integration with Google Cloud Ecosystem**: Seamlessly integrates with services like Cloud Logging, Cloud Trace, Kubernetes Engine (GKE), and other GCP tools to provide a unified observability experience across your cloud environment.

## Authentication Options

Below are possible authentication options you can choose:

<Tabs>
  <Tab title="Built-in xpander.ai Auth">
    The simplest way to connect Google Cloud Monitoring is by using xpander.ai's built-in authentication:

    1. Go to the **Connectors** section in the sidebar of your xpander.ai dashboard.
    2. Select **Google Cloud Monitoring** from the available integrations.
    3. Click **+ Create new connection**.
    4. Enter a **connector name** as desired, e.g., "xpander-cloud-monitoring".
    5. Choose **OAuth2** as the authentication method.
    6. Click **Sign in with Google Cloud Monitoring**.
    7. Grant xpander.ai permission to access your account.
    8. Save the configuration.

           <img src="https://mintcdn.com/xpanderai-099931d1/zTiJ5SGcQ71byr4d/images/connectors/google-cloud-monitoring/img_1.png?fit=max&auto=format&n=zTiJ5SGcQ71byr4d&q=85&s=a0d848f4a73c430f3b8002a44ce07d5c" alt="Img 1" width="2186" height="1422" data-path="images/connectors/google-cloud-monitoring/img_1.png" />
  </Tab>

  <Tab title="API Access">
    ### Generate a Google Cloud Monitoring API Token

    1. You’ll need access to the Google Cloud CLI tool to obtain your token. If it’s already installed, skip to step 5.

    2. Download the Google Cloud CLI tool.

    3. In the directory where you downloaded and extracted the SDK, run the installation script:

    ```
    ./google-cloud-sdk/install.sh
    ```

    4. After installation, add the SDK’s `bin` directory to your `$PATH`:

    ```
    export PATH="$PATH:$HOME/Downloads/google-cloud-sdk/bin"
    ```

    5. Initialize the gcloud CLI:

    ```
    ./google-cloud-sdk/bin/gcloud init
    ```

    6. Run the following command and copy the token it generates:

    ```
    gcloud auth print-access-token
    ```

    ### Integrate Google Cloud Monitoring into xpander.ai

    1. Go to the **Connectors** section in the sidebar of your xpander.ai dashboard.
    2. Select **Google Cloud Monitoring** from the available integrations.
    3. Click **+ Create new connection**.
    4. Enter a **connector name** as desired, e.g., "xpander-cloud-monitoring".
    5. Choose **API Key** as the authentication method.
    6. Paste your Google Cloud Monitoring access token into the provided field.
    7. Choose **Bearer** as the **Auth Type**.
    8. Save the configuration.

           <img src="https://mintcdn.com/xpanderai-099931d1/zTiJ5SGcQ71byr4d/images/connectors/google-cloud-monitoring/img_2.png?fit=max&auto=format&n=zTiJ5SGcQ71byr4d&q=85&s=80941b2b268312b8b3b8118b660e9337" alt="Img 2" width="2292" height="1420" data-path="images/connectors/google-cloud-monitoring/img_2.png" />
  </Tab>
</Tabs>

## Integration of Google Cloud Monitoring into an AI Agent

Once you’ve configured your Google Cloud Monitoring connector with the authentication option described above, you can integrate it into your AI agent with xpander.ai:

1. In your xpander.ai dashboard, navigate to the **Agents** page, then click an agent to open the **Agent Configuration** tab.

2. Select **Tools**, then click **Add Tools**.

3. Select **Connectors**.

4. Choose **Google Cloud Monitoring** with the same **connector name** you configured in the previous section (e.g., xpander-cloud-monitoring).

5. Select the available Google Cloud Monitoring operations that suit your use case.

   To grant your agent cloud monitoring capabilities, enable the following operations.

   * **List Project Alerts**
   * **Get Alert**
   * **List Folder Time Series**
   * **Get Alert Policy**
   * **List Metric Descriptor**
   * **List Project Alert Snoozes**

6. Click **Deploy** to update your agent.

<img src="https://mintcdn.com/xpanderai-099931d1/zTiJ5SGcQ71byr4d/images/connectors/google-cloud-monitoring/img_3.png?fit=max&auto=format&n=zTiJ5SGcQ71byr4d&q=85&s=20dcc99f71b8bab43f657cbe5211f0d7" alt="Img 3" width="2876" height="1558" data-path="images/connectors/google-cloud-monitoring/img_3.png" />

## AI Agent Google Cloud Monitoring Prompt Library

Below are possible prompts or use cases you can try after integrating Google Cloud Monitoring into your xpander.ai AI agent:

```
List all active alerting policies in my Google Cloud project.
```

```
Show me the CPU utilization metrics for my Compute Engine instances in the last 24 hours.
```

```
Show uptime check results for <service_name> over the past 7 days.
```

```
Get memory usage metrics for <resource_name> for the last 1 hour.
```

<img src="https://mintcdn.com/xpanderai-099931d1/zTiJ5SGcQ71byr4d/images/connectors/google-cloud-monitoring/gif_1.gif?s=32f0b483e8e0e8fc65f6f5d925c862c9" alt="Gif 1" width="800" height="908" data-path="images/connectors/google-cloud-monitoring/gif_1.gif" />

## Related Resources

* [Using Tools & Connectors in the xpander.ai platform](/guides/agents/tools-connectors)
* [Google Cloud Monitoring Documentation](https://docs.cloud.google.com/monitoring/docs)
