From cd63c1153fef6a314a3b5def8f534fec0778c1e5 Mon Sep 17 00:00:00 2001 From: Doug Lauder Date: Tue, 14 Apr 2020 22:30:27 -0400 Subject: [PATCH] MM-24096 add telemetry for audit log config (#14282) * MM-24096 add telemetry for audit log config * added audit config telemetry to unit test --- app/diagnostics.go | 13 +++++++++++++ app/diagnostics_test.go | 2 ++ 2 files changed, 15 insertions(+) diff --git a/app/diagnostics.go b/app/diagnostics.go index b3c3c32867..7a413e950c 100644 --- a/app/diagnostics.go +++ b/app/diagnostics.go @@ -23,6 +23,7 @@ const ( TRACK_CONFIG_CLIENT_REQ = "config_client_requirements" TRACK_CONFIG_SQL = "config_sql" TRACK_CONFIG_LOG = "config_log" + TRACK_CONFIG_AUDIT = "config_audit" TRACK_CONFIG_NOTIFICATION_LOG = "config_notifications_log" TRACK_CONFIG_FILE = "config_file" TRACK_CONFIG_RATE = "config_rate" @@ -391,6 +392,18 @@ func (a *App) trackConfig() { "isdefault_file_location": isDefault(cfg.LogSettings.FileLocation, ""), }) + a.SendDiagnostic(TRACK_CONFIG_AUDIT, map[string]interface{}{ + "syslog_enabled": *cfg.ExperimentalAuditSettings.SysLogEnabled, + "syslog_insecure": *cfg.ExperimentalAuditSettings.SysLogInsecure, + "syslog_max_queue_size": *cfg.ExperimentalAuditSettings.SysLogMaxQueueSize, + "file_enabled": *cfg.ExperimentalAuditSettings.FileEnabled, + "file_max_size_mb": *cfg.ExperimentalAuditSettings.FileMaxSizeMB, + "file_max_age_days": *cfg.ExperimentalAuditSettings.FileMaxAgeDays, + "file_max_backups": *cfg.ExperimentalAuditSettings.FileMaxBackups, + "file_compress": *cfg.ExperimentalAuditSettings.FileCompress, + "file_max_queue_size": *cfg.ExperimentalAuditSettings.FileMaxQueueSize, + }) + a.SendDiagnostic(TRACK_CONFIG_NOTIFICATION_LOG, map[string]interface{}{ "enable_console": *cfg.NotificationLogSettings.EnableConsole, "console_level": *cfg.NotificationLogSettings.ConsoleLevel, diff --git a/app/diagnostics_test.go b/app/diagnostics_test.go index 054d0b9b50..5d780e98c8 100644 --- a/app/diagnostics_test.go +++ b/app/diagnostics_test.go @@ -171,6 +171,7 @@ func TestDiagnostics(t *testing.T) { TRACK_CONFIG_TEAM, TRACK_CONFIG_SQL, TRACK_CONFIG_LOG, + TRACK_CONFIG_AUDIT, TRACK_CONFIG_NOTIFICATION_LOG, TRACK_CONFIG_FILE, TRACK_CONFIG_RATE, @@ -222,6 +223,7 @@ func TestDiagnostics(t *testing.T) { TRACK_CONFIG_TEAM, TRACK_CONFIG_SQL, TRACK_CONFIG_LOG, + TRACK_CONFIG_AUDIT, TRACK_CONFIG_NOTIFICATION_LOG, TRACK_CONFIG_FILE, TRACK_CONFIG_RATE,