Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Google Cloud SQL Query Insights #385

Open
ve6yeq opened this issue Feb 3, 2021 · 1 comment
Open

Add support for Google Cloud SQL Query Insights #385

ve6yeq opened this issue Feb 3, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@ve6yeq
Copy link

ve6yeq commented Feb 3, 2021

Recently, a new feature Query Insights was added to Google Cloud SQL for PostgreSQL. This is enabled with the following new keys on the SQLInstance resource:

apiVersion: sql.cnrm.cloud.google.com/v1beta1
kind: SQLInstance
settings:
    insightsConfig:
      queryInsightsEnabled: true
      queryStringLength: 1024
      recordApplicationTags: true
      recordClientAddress: true

As there is strict checking of allowed keys, the following patch needs to be applied:

diff --git a/crds/sql_v1beta1_sqlinstance.yaml b/crds/sql_v1beta1_sqlinstance.yaml
index c20c085..24cc9c3 100644
--- a/crds/sql_v1beta1_sqlinstance.yaml
+++ b/crds/sql_v1beta1_sqlinstance.yaml
@@ -337,6 +337,21 @@ spec:
                     requireSsl:
                       type: boolean
                   type: object
+                insightsConfig:
+                  description: Query Insights helps you detect, diagnose, and prevent query performance problems.
+                  properties:
+                    queryInsightsEnabled:
+                      description: Enable Query Insights on this Instance.
+                      type: boolean
+                    queryStringLength:
+                      description: The query string length in bytes to be stored by the query insights feature. Default length is 1024 bytes. Allowed range: 256 to 4500 bytes.
+                      type: integer
+                    recordApplicationTags:
+                      description: Enable the storage of application tags.
+                      type: boolean
+                    recordClientAddress:
+                      description: Enable the storage client IP addresses.
+                      type: boolean
                 locationPreference:
                   properties:
                     followGaeApplication:
@ve6yeq ve6yeq added the enhancement New feature or request label Feb 3, 2021
@xiaobaitusi
Copy link
Contributor

Hi @ve6yeq, thanks for making the enhancement request.

Since Config Connector uses terraform provider under the hood, these fields should be added into Terraform first. Then our pipeline will introduce those fields on the next version.

Here is the Terraform feature request to track - hashicorp/terraform-provider-google#8328

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants