[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],null,["# Monitor and troubleshoot with AI assistance\n\n\u003cbr /\u003e\n\nThis document describes how you can use AI assistance to help you monitor and troubleshoot\nyour AlloyDB for PostgreSQL resources. You can\nuse the AI-assisted troubleshooting tools of AlloyDB\nand [Gemini Cloud Assist](/gemini/docs/cloud-assist/overview) to\n[improve query performance](#improve-query-performance) and\n[monitor system performance](#monitor-system-performance).\n| As an early-stage technology, Gemini for Google Cloud\n| products can generate output that seems plausible but is factually incorrect. We recommend that you\n| validate all output from Gemini for Google Cloud products before you use it.\n| For more information, see\n| [Gemini for Google Cloud and responsible AI](/gemini/docs/discover/responsible-ai).\n\nLimitations\n-----------\n\nThe following limitations apply to AI-assisted troubleshooting in AlloyDB:\n\n- AI-assisted troubleshooting offers valuable insights based on standard PostgreSQL configurations. AlloyDB's unique architecture, including its disaggregated storage, caching, columnar engine, and optimized background processes, means that certain checks and recommendations can differ from actual AlloyDB performance metrics. We recommend that you consider AI-assisted troubleshooting recommendations as starting points and refer to the [AlloyDB documentation](/alloydb/docs/overview) for definitive guidance.\n- For the best results, wait 24 hours after you [enable AI-assisted troubleshooting](#enable-ai-assisted-ts) in the Google Cloud console to let AlloyDB build a baseline of the average performance of your instance, database, and queries.\n- AI-assisted troubleshooting isn't supported for the following AlloyDB configurations:\n - Instances inside a [VPC Service Controls perimeter](/vpc-service-controls/docs/overview)\n - Instances enabled with [Access Transparency](/assured-workloads/access-transparency/docs/overview)\n\nBefore you begin\n----------------\n\n[Ensure that\nGemini Cloud Assist is set up for your Google Cloud user account\nand project](/gemini/docs/cloud-assist/set-up-gemini).\n\nAfter you set up Gemini Cloud Assist,\nyou might need to wait five minutes to let the service propagate\nbefore you can enable AI-assisted troubleshooting\nin AlloyDB.\n\n\u003cbr /\u003e\n\n### Required roles and permissions\n\n\nTo get the permissions that\nyou need to use AI-assisted troubleshooting,\n\nask your administrator to grant you the\n\n\n[Database insights viewer](/iam/docs/roles-permissions/databaseinsights#databaseinsights.viewer) (`roles/databaseinsights.viewer`)\nIAM role on the project that hosts the AlloyDB instance.\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nThis predefined role contains\n\nthe permissions required to use AI-assisted troubleshooting. To see the exact permissions that are\nrequired, expand the **Required permissions** section:\n\n\n#### Required permissions\n\nThe following permissions are required to use AI-assisted troubleshooting:\n\n- ` databaseinsights.performanceIssues.detect `\n- ` databaseinsights.performanceIssues.investigate`\n\n\nYou might also be able to get\nthese permissions\nwith [custom roles](/iam/docs/creating-custom-roles) or\nother [predefined roles](/iam/docs/roles-overview#predefined).\n\nEnable AI-assisted troubleshooting\n----------------------------------\n\nWhen you enable AI-assisted troubleshooting for your AlloyDB instance,\nAlloyDB can analyze the performance of your databases and detect\nanomalies in the execution of your queries. When AlloyDB detects\nanomalies in query performance or identifies high system\nload, AI-assisted troubleshooting helps you analyze the situation with evidence\nand provides recommendations.\n\nTo enable AI-assisted troubleshooting\nfor your AlloyDB instance, do the following:\n\n1. In the Google Cloud console, go to the **Clusters** page.\n\n [Go to Clusters](https://console.cloud.google.com/alloydb/clusters)\n2. From the list of clusters and instances, click an instance.\n\n3. Click **Query insights**.\n\n4. Click either **Enable** or **Edit settings**.\n\n5. In the **Edit query insights settings** tab, select the **Enable advanced query insights features for AlloyDB** checkbox.\n\n By default, this turns on the **AI-assisted troubleshooting** checkbox.\n | **Note:** Enabling advanced query insights features requires you to restart your instance.\n6. Click **Save**.\n\nFor more information about enabling advanced query insights, see\n[Improve query performance using advanced query insights](/alloydb/docs/using-advanced-query-insights#enable-advanced-features).\n\n\nOpen Gemini Cloud Assist\n------------------------\n\nTo use Gemini Cloud Assist with AlloyDB,\ndo the following:\n\n1. In the Google Cloud console, go to the **Clusters** page.\n[Go to Clusters](https://console.cloud.google.com/alloydb/clusters)\n2. From the list of clusters and instances, click an instance.\n3. Click **Query insights**.\n4. To open the **[Cloud Assist panel](/gemini/docs/cloud-assist-panel)** , click spark **Open or close Gemini AI chat**.\n5. In the **Cloud Assist panel**, enter a prompt that describes the information that you're interested in.\n6. After you enter the prompt, click send **Send prompt**. Gemini returns a response to your prompt based on information from the last hour.\n\nImprove query performance\n-------------------------\n\nUse AI assistance to troubleshoot individual slow queries in AlloyDB\nin using the **Query insights** dashboard.\nFor more information, see [Troubleshoot slow queries with AI assistance](/alloydb/docs/troubleshoot/slow-queries-ai).\n\nYou can also use Gemini Cloud Assist to enter prompts to help\nyou improve the performance of your queries. Gemini Cloud Assist\nanswers questions for the selected AlloyDB instance and database.\n\n### Examples of query performance prompts\n\nMonitor system performance\n--------------------------\n\nYou can use AI assistance to analyze database load in AlloyDB from the\n**Overview** page or the **Query insights** dashboard.\n\nFor more information, see\n[Troubleshoot high database load with AI assistance](/alloydb/docs/troubleshoot/high-database-load-ai).\n\n\nYou can also use Gemini Cloud Assist to enter prompts to gather\ninformation about your system performance. Gemini Cloud Assist\nanswers questions for the selected AlloyDB instance.\n\n### Examples of system performance prompts\n\nGet index recommendations\n-------------------------\n\n| **Note:** You don't need to enable AI-assisted troubleshooting to obtain index recommendations.\n\nYou can obtain index recommendations from AlloyDB in query insights.\n\nFor more information, see\n[Index advisor overview](/alloydb/docs/index-advisor-overview).\n\n\nIn addition, using Gemini Cloud Assist, you can get more\ninformation about how to use indexes in your databases.\nGemini Cloud Assist answers questions for the\nselected AlloyDB instance.\n\n### Examples of index recommendation prompts\n\nMonitor active queries\n----------------------\n\n| **Note:** You don't need to enable AI-assisted troubleshooting to monitor active queries.\n\nUse the **Query insights** dashboard to monitor active queries, and if necessary,\nterminate long-running processes.\n\nFor more information, see\n[Monitor active queries](/alloydb/docs/monitor-active-queries).\n\n\nIn addition, using Gemini Cloud Assist, you can enter prompts\nto find out more information about queries that cause high latency or CPU load.\nGemini Cloud Assist answers questions for the selected\nAlloyDB instance.\n\n### Examples of active query prompts\n\nWhat's next\n-----------\n\n- Learn how to [write better prompts](/gemini/docs/discover/write-prompts).\n- Learn how to use the [Gemini Cloud Assist panel](/gemini/docs/cloud-assist-panel).\n- Read [Use Gemini for AI assistance and development](/gemini/docs/overview)\n- Learn [how and when Gemini\n for Google Cloud uses your data](/gemini/docs/discover/data-governance)."]]