From 09d1c1941b64614980b92ab327d5377b99ba66b6 Mon Sep 17 00:00:00 2001 From: Thomas von Dein Date: Thu, 18 Apr 2024 09:56:56 +0200 Subject: [PATCH 1/2] fix pg_stat_statement query: add queryid to make it unique --- charts/postgreslet/Chart.yaml | 4 ++-- charts/postgreslet/values.yaml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/charts/postgreslet/Chart.yaml b/charts/postgreslet/Chart.yaml index 816bfe5..78a0c06 100644 --- a/charts/postgreslet/Chart.yaml +++ b/charts/postgreslet/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.11.0 +version: 0.11.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v0.13.1" \ No newline at end of file +appVersion: "v0.13.1" diff --git a/charts/postgreslet/values.yaml b/charts/postgreslet/values.yaml index e45203c..e2c7da1 100644 --- a/charts/postgreslet/values.yaml +++ b/charts/postgreslet/values.yaml @@ -422,6 +422,7 @@ sidecars: query: "SELECT pg_get_userbyid(userid) as user, pg_database.datname, + pg_stat_statements.queryid, pg_stat_statements.query, pg_stat_statements.calls, pg_stat_statements.total_exec_time as time_milliseconds, From aae075a86ee7ed15abbd25f9641bddaa8db25598 Mon Sep 17 00:00:00 2001 From: Thomas von Dein Date: Thu, 18 Apr 2024 10:33:03 +0200 Subject: [PATCH 2/2] added metric queryid + distinct just to be sure to have uniq metrics --- charts/postgreslet/values.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/charts/postgreslet/values.yaml b/charts/postgreslet/values.yaml index e2c7da1..63505ff 100644 --- a/charts/postgreslet/values.yaml +++ b/charts/postgreslet/values.yaml @@ -420,6 +420,7 @@ sidecars: pg_stat_statements: # user, datname, query, calls, total_exec_time, rows. query: "SELECT + distinct pg_get_userbyid(userid) as user, pg_database.datname, pg_stat_statements.queryid, @@ -438,6 +439,9 @@ sidecars: - datname: usage: "LABEL" description: "The database in which the statement was executed" + - queryid: + usage: "LABEL" + description: "Query ID" - query: usage: "LABEL" description: "Processed query"