Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

PMM-10068: fix PMMServerSTTEnabled query #1131

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions services/telemetry/config.default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ telemetry:

- id: PMMServerSTTEnabled
source: PMMDB_SELECT
query: stt->'stt_enabled' AS stt_enabled FROM settings s, jsonb_extract_path(s.settings, 'sass') AS stt
query: (CASE WHEN stt->'stt_disabled' = 'false' THEN 'true' ELSE 'false' END) AS stt_enabled FROM settings s, jsonb_extract_path(s.settings, 'sass') AS stt
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stt_enabled no longer exist

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can it be simplified like below?

Suggested change
query: (CASE WHEN stt->'stt_disabled' = 'false' THEN 'true' ELSE 'false' END) AS stt_enabled FROM settings s, jsonb_extract_path(s.settings, 'sass') AS stt
query: stt->'stt_disabled' != 'false' AS stt_enabled FROM settings s, jsonb_extract_path(s.settings, 'sass') AS stt

summary: "PMM Server Security Thread Tool feature enabled/disabled"
data:
- metric_name: "stt_enabled"
Expand All @@ -32,14 +32,6 @@ telemetry:
- metric_name: "dbaas_enabled"
column: "dbaas_enabled"

- id: PMMServerDBaaSEnabled
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that we have a duplicate

source: PMMDB_SELECT
query: dbaas->'enabled' AS dbaas_enabled FROM settings s, jsonb_extract_path(s.settings, 'dbaas') AS dbaas
summary: "PMM Server DBaaS feature enabled/disabled"
data:
- metric_name: "dbaas_enabled"
column: "dbaas_enabled"

- id: PMMServerUpdatesDisabled
source: PMMDB_SELECT
query: updates->'disabled' AS updates_disabled FROM settings s, jsonb_extract_path(s.settings, 'updates') AS updates
Expand Down