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

PMM-13146 Fix v3 telemetry issues #3154

Merged
merged 16 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
2 changes: 1 addition & 1 deletion docs/process/v2_to_v3_environment_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Below is a list of affected variables and their new names.
| `DISABLE_UPDATES` | `PMM_ENABLE_UPDATES` | |
| `DISABLE_TELEMETRY` | `PMM_ENABLE_TELEMETRY` | |
| `PERCONA_PLATFORM_API_TIMEOUT` | `PMM_DEV_PERCONA_PLATFORM_API_TIMEOUT` | |
| `DISABLE_BACKUP_MANAGEMENT` | `PMM_DISABLE_BACKUP_MANAGEMENT` | |
| `DISABLE_BACKUP_MANAGEMENT` | | Removed in PMM v3, use `PMM_ENABLE_BACKUP_MANAGEMENT` |
ademidoff marked this conversation as resolved.
Show resolved Hide resolved
| `ENABLE_AZUREDISCOVER` | `PMM_ENABLE_AZURE_DISCOVER` | |
| `ENABLE_RBAC` | `PMM_ENABLE_ACCESS_CONTROL` | |
| `LESS_LOG_NOISE` | | Removed in PMM v3 |
Expand Down
72 changes: 38 additions & 34 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,45 +24,45 @@ telemetry:
- metric_name: "pmm_server_alert_rules_number"
value: 1

- id: PMMServerSTTEnabled
- id: PMMServerAdvisorsEnabled
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"
query: (CASE WHEN advisors->'enabled' = 'true' THEN '1' WHEN advisors->'enabled' = 'null' THEN '1' ELSE '0' END) AS advisors_disabled FROM settings s, jsonb_extract_path(s.settings, 'sass') AS advisors
ademidoff marked this conversation as resolved.
Show resolved Hide resolved
summary: "PMM Advisors Enabled"
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
summary: "PMM Advisors Disabled"
data:
- metric_name: "pmm_server_advisors_disabled"
column: "advisors_disabled"
- metric_name: "pmm_server_advisors_enabled"
idoqo marked this conversation as resolved.
Show resolved Hide resolved
column: "advisors_enabled"

- 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
summary: "PMM Server Access Control feature enabled/disabled"
query: (CASE WHEN access_control->'enabled' = 'true' THEN '1' WHEN access_control->'enabled' = 'null' THEN '0' 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"
data:
- metric_name: "pmm_server_access_control_enabled"
column: "access_control_enabled"

- id: PMMServerUpdatesDisabled
- id: PMMServerUpdatesEnabled
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
summary: "PMM Server Check Updates feature disabled"
query: (CASE WHEN updates->'enabled' = 'true' THEN '1' WHEN updates->'enabled' = 'null' THEN '1' ELSE '0' END) AS updates_disabled FROM settings s, jsonb_extract_path(s.settings, 'updates') AS updates
summary: "PMM Server Check Updates feature enabled"
data:
- metric_name: "pmm_server_updates_disabled"
column: "updates_disabled"
- metric_name: "pmm_server_updates_enabled"
column: "updates_enabled"

- 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
Expand Down Expand Up @@ -92,14 +92,12 @@ telemetry:
summary: "Plugins on the MySQL instance"
data:
- metric_name: "1"
label: "library"
- metric_name: "2"
ademidoff marked this conversation as resolved.
Show resolved Hide resolved
label: "license"
- metric_name: "3"
- metric_name: "2"
label: "name"
- metric_name: "4"
- metric_name: "3"
label: "status"
- metric_name: "5"
- metric_name: "4"
label: "type"

- id: MySQLEngineRocksDBCount
Expand Down Expand Up @@ -911,7 +909,6 @@ telemetry:
from dumps
where created_at BETWEEN NOW() - INTERVAL '24 HOURS' AND NOW()
group by status, services_count, timerange, ignore_load, export_qan;

transform:
type: JSON
metric: pmm_dumps_performed
Expand Down Expand Up @@ -951,12 +948,19 @@ telemetry:
- metric_name: "postgresql_db_count"
value: 1

- id: PMMServerHAEnabled
ademidoff marked this conversation as resolved.
Show resolved Hide resolved
- id: PMMServerTelementryEnabled
ademidoff marked this conversation as resolved.
Show resolved Hide resolved
source: ENV_VARS
summary: "Use of telemetry feature"
data:
- metric_name: "pmm_server_telemetry_enable"
column: "PMM_ENABLE_TELEMETRY"

- id: PMMServerBuiltinDatabaseDisabled
source: ENV_VARS
summary: "Use of HA feature"
ademidoff marked this conversation as resolved.
Show resolved Hide resolved
data:
- metric_name: "pmm_server_ha_enable"
column: "PERCONA_TEST_HA_ENABLE"
- metric_name: "pmm_server_builtin_postgres_disable"
column: "PMM_DISABLE_BUILTIN_POSTGRES"

- id: PMMServerHAUseOfDBs
source: ENV_VARS
Expand Down
4 changes: 2 additions & 2 deletions managed/utils/envvars/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func ParseEnvVars(envs []string) (*models.ChangeSettingsParams, []error, []strin
}
envSettings.EnableAzurediscover = &b

case "ENABLE_BACKUP_MANAGEMENT":
case "PMM_ENABLE_BACKUP_MANAGEMENT":
b, err := strconv.ParseBool(v)
if err != nil {
errs = append(errs, fmt.Errorf("invalid value %q for environment variable %q", v, k))
Expand All @@ -173,7 +173,7 @@ func ParseEnvVars(envs []string) (*models.ChangeSettingsParams, []error, []strin
case "PMM_VM_URL":
_, err = url.Parse(v)
if err != nil {
err = fmt.Errorf("invalid value %q for environment variable %q", v, k)
errs = append(errs, fmt.Errorf("invalid value %q for environment variable %q", v, k))
ademidoff marked this conversation as resolved.
Show resolved Hide resolved
}

case "PMM_INSTALL_METHOD", "PMM_DISTRIBUTION_METHOD":
Expand Down
Loading