Unable to disable query insights using gcloud

I have a Google CloudSQL postgres instance that has query insight enabled

I attempt to disable it with the command below, but get the 400 error. Anyone else have this problem? Through testing, I realize this is only an issue when ‘Enable Enterprise Plus features’ is turned on under query insights

$ gcloud sql instances patch my_instance --no-insights-config-query-insights-enabled

The following message will be used for the patch API method.
{“name”: “my_instance”, “project”: “my_project”, “settings”: {“insightsConfig”: {“queryInsightsEnabled”: false}}}

ERROR: (gcloud.sql.instances.patch) HTTPError 400: Invalid request: Query insights is not enabled for the instance.

Yep, I ran into the same issue before. When enterprise features is on, query insights is auto managed so the API treats it as read only. The only fix I found is turning off enterprise plus first. Hope it helps.

Got it, thank you!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.