Skip to content

Commit

Permalink
PMM-13146 Fix the collection of server settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ademidoff committed Aug 15, 2024
1 parent 6a42b21 commit 422d5b4
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions managed/services/telemetry/config.default.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
telemetry:
# PMM - generic information
- id: PMMServerIAEnabled
- id: PMMServerAlertingEnabled
source: PMMDB_SELECT
query: (CASE WHEN alerting->'disabled' = 'false' THEN '1' ELSE '0' END) AS ia_enabled FROM settings s, jsonb_extract_path(s.settings, 'alerting') AS alerting
query: (CASE WHEN alerting->'enabled' = 'true' THEN '1' WHEN alerting->'enabled' = 'null' THEN '1' ELSE '0' END) AS alerting_enabled FROM settings s, jsonb_extract_path(s.settings, 'alerting') AS alerting
summary: "PMM Server Integration Alerting feature enabled/disabled"
data:
- metric_name: "pmm_server_ia_enabled"
column: "ia_enabled"
- metric_name: "pmm_server_alerting_enabled"
column: "alerting_enabled"

- id: PMMServerAlertsFire
source: VM
Expand All @@ -24,46 +24,46 @@ telemetry:
- metric_name: "pmm_server_alert_rules_number"
value: 1

- id: PMMServerSTTEnabled
source: PMMDB_SELECT
query: (CASE WHEN stt->'stt_disabled' = 'false' THEN '1' ELSE '0' END) 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: "pmm_server_stt_enabled"
column: "stt_enabled"

- id: PMMServerAdvisorsDisabled
source: PMMDB_SELECT
query: (CASE WHEN advisors->'enabled' = 'true' THEN '0' ELSE '1' END) AS advisors_disabled FROM settings s, jsonb_extract_path(s.settings, 'sass') AS advisors
query: (CASE WHEN advisors->'enabled' = 'true' THEN '0' WHEN advisors->'enabled' = 'null' THEN '0' ELSE '1' END) AS advisors_disabled FROM settings s, jsonb_extract_path(s.settings, 'sass') AS advisors
summary: "PMM Advisors Disabled"
data:
- metric_name: "pmm_server_advisors_disabled"
column: "advisors_disabled"

- id: PMMServerBackupManagementEnabled
source: PMMDB_SELECT
query: (CASE WHEN backup_management->'disabled' = 'false' THEN '1' ELSE '0' END) AS backup_management_enabled FROM settings s, jsonb_extract_path(s.settings, 'backup_management') AS backup_management
query: (CASE WHEN backup_management->'enabled' = 'true' THEN '1' WHEN backup_management->'enabled' = 'null' THEN '1' ELSE '0' END) AS backup_management_enabled FROM settings s, jsonb_extract_path(s.settings, 'backup_management') AS backup_management
summary: "PMM Server Backup Management feature enabled"
data:
- metric_name: "pmm_server_backup_management_enabled"
column: "backup_management_enabled"

- id: PMMServerAccessControlEnabled
source: PMMDB_SELECT
query: (CASE WHEN access_control->'enabled' = 'true' THEN '1' ELSE '0' END) AS access_control_enabled FROM settings s, jsonb_extract_path(s.settings, 'access_control') AS access_control
query: (CASE WHEN access_control->'enabled' = 'true' THEN '1' WHEN access_control->'enabled' = 'null' THEN '1' ELSE '0' END) AS access_control_enabled FROM settings s, jsonb_extract_path(s.settings, 'access_control') AS access_control
summary: "PMM Server Access Control feature enabled/disabled"
data:
- metric_name: "pmm_server_access_control_enabled"
column: "access_control_enabled"

- id: PMMServerUpdatesDisabled
source: PMMDB_SELECT
query: (CASE WHEN updates->'disabled' = 'true' THEN '1' ELSE '0' END) AS updates_disabled FROM settings s, jsonb_extract_path(s.settings, 'updates') AS updates
query: (CASE WHEN updates->'enabled' = 'true' THEN '0' WHEN updates->'enabled' = 'null' THEN '0' ELSE '1' END) AS updates_disabled FROM settings s, jsonb_extract_path(s.settings, 'updates') AS updates
summary: "PMM Server Check Updates feature disabled"
data:
- metric_name: "pmm_server_updates_disabled"
column: "updates_disabled"

- id: PMMAzureMonitoringEnabled
source: PMMDB_SELECT
query: (CASE WHEN azure->'enabled' = 'true' THEN '1' WHEN azure->'enabled' = 'null' THEN '1' ELSE '0' END) AS azure_enabled FROM settings s, jsonb_extract_path(s.settings, 'azure') AS azure
summary: "PMM Azure monitoring feature enabled"
data:
- metric_name: "pmm_server_azure_enabled"
column: "azure_enabled"

- id: PMMServerFirstServiceAdded
source: PMMDB_SELECT
query: EXTRACT(EPOCH FROM y.created_at::timestamp) - EXTRACT(EPOCH FROM x.created_at::timestamp) AS value_difference_sec FROM services x JOIN services y ON y.service_name != 'pmm-server-postgresql' WHERE x.service_name = 'pmm-server-postgresql' AND y.created_at = (SELECT MIN(created_at) FROM services WHERE service_name != 'pmm-server-postgresql');
Expand Down Expand Up @@ -92,7 +92,7 @@ telemetry:
summary: "Plugins on the MySQL instance"
data:
- metric_name: "1"
label: "library"
label: "library" # is not available
- metric_name: "2"
label: "license"
- metric_name: "3"
Expand Down

0 comments on commit 422d5b4

Please sign in to comment.