Analyze and optimize Google Cloud resources

This document describes how to use the conversational assistant in Gemini Cloud Assist to analyze and optimize Google Cloud resources.

In Gemini Cloud Assist, you can use the Cloud Assist panel to write natural language statements or questions (called prompts) to get in-depth explanations, suggested actions, or guided workflows. These resources help you complete tasks quickly and efficiently without needing to be a cloud expert.

Before you begin

Open the Cloud Assist panel

  1. Go to any page in the Google Cloud console, such as the Gemini for Google Cloud page.

    Go to Gemini for Google Cloud

  2. In the Google Cloud console toolbar, click spark Open or close Gemini AI chat.

    The Cloud Assist panel opens and displays a few example prompts that you can click. The prompts vary depending on your current Google Cloud console page.

  3. Optional: Write natural language prompts for assistance.

Prompt Gemini Cloud Assist for assistance

This section includes a few example scenarios and related prompts that you can enter in the Cloud Assist panel.

Generate SQL queries

The following example shows how to generate SQL queries from the Cloud Assist panel while in BigQuery pages of the Google Cloud console:

  1. In the Cloud Assist panel, send the following prompt:

    Generate a SQL query to show me the duration and subscriber type for the ten
    longest trips.
    

    In this example, Gemini Cloud Assist provides a specific SQL query that you can review and copy into the BigQuery query editor.

  2. Optional: Send a prompt to generate Python code:

    Generate Python code to query the bigquery-public-data.ml_datasets.penguins
    table using bigquery magics.
    

Understand deployed assets and their recent changes

Your project must have an organization to understand deployed assets and their recent changes. Projects that don't have an organization are not supported.

The following example uses the Cloud Asset Inventory.

  1. In the Cloud Assist panel, send the following prompt: What are the names of my instances and their private interface names?

    Gemini Cloud Assist lists instances, their names, and private interface names.

  2. Optional: Send any of the following prompts for similar scenarios:

    • List the name and network name for the subnetworks.
    • List my artifact repo.
    • How many BigQuery datasets have a label whose value is 'foo'?
    • List all config changes in the last 24 hours.
    • List all users granted roles/bigquery.admin and include the attached resources.
    • List a BigQuery dataset organized by name and location.
    • Describe the configuration of "pubsub/topic/…"

Analyze database query and system performance

The following example shows how to get the query performance data from the Cloud Assist panel while on the following tabs of a specific database instance in the Cloud SQL page of the Google Cloud console:

  • Overview
  • System Insights
  • Query Insights
  • Query Details
  1. In the Cloud Assist panel, send the following prompt:

    What's the current CPU utilization of this database?
    

    The response includes a list of all the compliance issues for the database fleet with a table that breaks down each category and the resource count.

  2. Optional: Send any of the following prompts for similar scenarios:

    • Summarize database query trends by users.
    • Which of my queries have high latency for this database instance?
    • What is the slowest query for this database in this instance?
    • What are the wait times for the query id = in this database?
    • How many error log entries are there for this database instance?

Understand database fleet health and compliance

The following example shows how to get the database fleet health and compliance data from the Cloud Assist panel:

  1. In the Cloud Assist panel, send the following prompt:

    How many databases do I have in the US?
    

    Gemini Cloud Assist provides a list of all of your databases in the US.

  2. Optional: Send any of the following prompts for similar scenarios:

    • Where are my databases located?
    • What issues are affecting my databases?
    • Show me all databases running on Postgres.
    • What databases have NIST issues in Europe?

The following example uses Cloud Monitoring.

  1. In the Cloud Assist panel, send the following prompt: Which of my VMs have the highest utilization?

    Gemini Cloud Assist provides a quick analysis of the performance trends of resources such as traffic, throughput, and executions.

  2. Optional: Send any of the following prompts for similar scenarios:

    • What are the top 5 dataflow jobs with the highest estimated backlog processing time?
    • Total VM network bytes sent per second for each instance?
    • What's the QPS on my SQL databases?

Find recommendations and optimization opportunities

The following example uses Active Assist.

  1. In the Cloud Assist panel, send the following prompt: Give me recommendations to reduce my resource costs.

    Gemini Cloud Assist provides specific recommendations for estimated savings and cluster reliability.

  2. Optional: Send any of the following prompts for similar scenarios:

    • What are all the quotas for my project that are almost hitting the limit?
    • What BigQuery datasets should I partition or cluster?
    • Which of my VMs are idle?

Understand App Hub applications, services, and workloads

The following example shows how to use the Cloud Assist panel while in the Google Cloud console to get a list of App Hub applications within an App Hub host project that a specific team member has access to.

  1. In the Cloud Assist pane, send the following prompt: Show me all applications in this project with the developer owner lee@example.com

    Gemini Cloud Assist returns a list of applications that meets the criteria you specified.

  2. Optional: Send any of the following prompts for specific scenarios:

    • List all the registered services in application "foo" in the location us-central1.
    • Show me all applications with user email myemail@example.com as business owners.
    • Describe my application "app-1" in us-east1.

Get a regulatory control recommendation

The following example shows how to use the Cloud Assist panel while in the Google Cloud console to get a recommendation for which Assured Workloads regulatory control package to use.

  1. In the Cloud Assist panel, send the following prompt: Help me choose a regulatory control for my Google Cloud folders.

    Gemini Cloud Assist begins a natural language conversation with you about your requirements and then suggests a best-fit control package.

  2. Optional: Send any of the following prompts for similar scenarios:

    • How do I set up an Assured Workloads control package?
    • How do I create an Assured Workloads folder?
    • How do I monitor an Assured Workloads folder for violations?

Learn about Cloud Storage storage classes

The following example shows how to use the Cloud Assist pane while in Cloud Storage pages to review the different storage classes you can use when storing data in your buckets.

  1. In the Cloud Assist pane, send the following prompt: What storage class should I use for my data?

    Gemini Cloud Assist returns a list of available storage classes and describes uses cases for each.

  2. Optional: If you have a Storage Intelligence subscription and the appropriate IAM roles to access Storage Insights datasets, you can send prompts about your specific buckets and objects. For example, you can send the following prompts:

    • How many bytes are stored in my buckets in the us-central1 location?
    • What is my Cloud storage usage, broken down by content type?
    • How many objects do I have in Standard storage smaller than 50 GB?

Track the cost of your project over time

The following example shows how to use the Cloud Assist pane while in the Google Cloud console to get the monthly cost of your project for the past year.

  1. In the Cloud Assist pane, send the following prompt: How much did I spend on this project last year by month?

    In order to get a direct answer to your question, you must have the appropriate IAM permission to access cost information for the project.

    Gemini Cloud Assist returns your costs per month over the specified date range.

  2. Optional: Send any of the following prompts for similar scenarios:

    • Which SKUs are costing me the most?
    • Did I spend more in October or November?

Understand data protection and privacy security controls

The following example shows how to use the Cloud Assist pane while in the Google Cloud console to create a Secret Manager secret and to list any Cloud Key Management Service keys you have.

  1. In the Cloud Assist panel, send the following prompt:

    Help me create a secret.
    

    Gemini Cloud Assist begins a natural language conversation with you that provides step-by-step guidance for creating a secret.

  2. Optional: As part of the step-by-step guidance, you can ask for recommendations, such as which protection is appropriate for your needs. For example, send any of the following prompts for additional guidance:

    • What protection level should I use for my Cloud KMS key?
    • Help me create a Confidential Space

    After finishing the steps, Gemini Cloud Assist produces the appropriate Terraform code and gcloud CLI commands to use.

  3. In the Cloud Assist panel, send the following prompt to return information about your security resources:

    List my Cloud KMS keys in a table.
    

    Gemini Cloud Assist returns the requested information.

  4. Optional: Send any of the following prompts for similar scenarios:

    • Which VMs have Confidential Computing enabled?
    • How many VMs have confidential Confidential Computing enabled?
    • What is the rotation policy for my Cloud KMS key?
    • When was my Cloud KMS key last rotated?

Check if there are any known Google Cloud incidents impacting your project

The following example shows how to use the Cloud Assist panel while in the Google Cloud console to get a list of ongoing Google Cloud incidents that could be impacting your project.

  1. In the Cloud Assist panel, send the following prompt: Is there something going on with Google Cloud? I'm seeing issues with my project.

    Gemini Cloud Assist reports any recent incidents that could be relevant to your project.

  2. Optional: Send any of the following prompts for similar scenarios:

    • What's the latest update on the Compute Engine outage in us-central1?
    • How is my project impacted by the Cloud Storage incident?
    • Is there a workaround for the BigQuery incident?

What's next