diff --git a/api-tests/server/logs_test.go b/api-tests/server/logs_test.go index 5c4585836c..f9ba59efc6 100644 --- a/api-tests/server/logs_test.go +++ b/api-tests/server/logs_test.go @@ -44,10 +44,8 @@ func TestDownloadLogs(t *testing.T) { assert.NoError(t, err) expected := []string{ - "alertmanager.base.yml", "alertmanager.ini", "alertmanager.log", - "alertmanager.yml", "clickhouse-server.log", "client/list.txt", "client/pmm-admin-version.txt", diff --git a/docs/api/pmm-server-config/troubleshooting/logs.md b/docs/api/pmm-server-config/troubleshooting/logs.md index 86909f0c87..23ad6c2b9d 100644 --- a/docs/api/pmm-server-config/troubleshooting/logs.md +++ b/docs/api/pmm-server-config/troubleshooting/logs.md @@ -13,7 +13,7 @@ The structure of the logs is as follows: { "codes": [ { - "code": "# tree\n├── alertmanager.base.yml\n├── alertmanager.ini\n├── alertmanager.log\n├── alertmanager.yml\n├── clickhouse-server.err.log\n├── clickhouse-server.log\n├── clickhouse-server.startup.log\n├── client\n│ ├── list.txt\n│ ├── pmm-admin-version.txt\n│ ├── pmm-agent-config.yaml\n│ ├── pmm-agent-version.txt\n│ └── status.json\n├── cron.log\n├── dashboard-upgrade.log\n├── dbaas-controller.log\n├── grafana.log\n├── installed.json\n├── nginx.conf\n├── nginx.log\n├── nginx.startup.log\n├── pmm-agent.log\n├── pmm-agent.yaml\n├── pmm-managed.log\n├── pmm-ssl.conf\n├── pmm-update-perform-init.log\n├── pmm-update-perform.log\n├── pmm-version.txt\n├── pmm.conf\n├── pmm.ini\n├── postgresql.log\n├── postgresql.startup.log\n├── prometheus.base.yml\n├── prometheus.log\n├── qan-api2.ini\n├── qan-api2.log\n├── supervisorctl_status.log\n├── supervisord.conf\n├── supervisord.log\n├── systemctl_status.log\n├── victoriametrics-promscrape.yml\n├── victoriametrics.ini\n├── victoriametrics.log\n├── victoriametrics_targets.json\n├── vmalert.ini\n└── vmalert.log", + "code": "# tree\n├── alertmanager.ini\n├── alertmanager.log\n├── clickhouse-server.err.log\n├── clickhouse-server.log\n├── clickhouse-server.startup.log\n├── client\n│ ├── list.txt\n│ ├── pmm-admin-version.txt\n│ ├── pmm-agent-config.yaml\n│ ├── pmm-agent-version.txt\n│ └── status.json\n├── cron.log\n├── dashboard-upgrade.log\n├── dbaas-controller.log\n├── grafana.log\n├── installed.json\n├── nginx.conf\n├── nginx.log\n├── nginx.startup.log\n├── pmm-agent.log\n├── pmm-agent.yaml\n├── pmm-managed.log\n├── pmm-ssl.conf\n├── pmm-update-perform-init.log\n├── pmm-update-perform.log\n├── pmm-version.txt\n├── pmm.conf\n├── pmm.ini\n├── postgresql.log\n├── postgresql.startup.log\n├── prometheus.base.yml\n├── prometheus.log\n├── qan-api2.ini\n├── qan-api2.log\n├── supervisorctl_status.log\n├── supervisord.conf\n├── supervisord.log\n├── systemctl_status.log\n├── victoriametrics-promscrape.yml\n├── victoriametrics.ini\n├── victoriametrics.log\n├── victoriametrics_targets.json\n├── vmalert.ini\n└── vmalert.log", "language": "text" } ] diff --git a/managed/services/checks/checks.go b/managed/services/checks/checks.go index c4e7d4609b..c3e95f0302 100644 --- a/managed/services/checks/checks.go +++ b/managed/services/checks/checks.go @@ -1490,7 +1490,7 @@ func (s *Service) filterSupportedChecks(advisors []check.Advisor) []check.Adviso for _, advisor := range advisors { checks := make([]check.Check, 0, len(advisor.Checks)) - loop: + LOOP: for _, c := range advisor.Checks { if c.Version > maxSupportedVersion { s.l.Warnf("Unsupported checks version: %d, max supported version: %d.", c.Version, maxSupportedVersion) @@ -1507,7 +1507,7 @@ func (s *Service) filterSupportedChecks(advisors []check.Advisor) []check.Adviso for _, query := range c.Queries { if ok := isQueryTypeSupported(query.Type); !ok { s.l.Warnf("Unsupported query type: %s.", query.Type) - continue loop + continue LOOP } } } diff --git a/managed/services/supervisord/logs.go b/managed/services/supervisord/logs.go index fc76f99228..951b12a071 100644 --- a/managed/services/supervisord/logs.go +++ b/managed/services/supervisord/logs.go @@ -32,10 +32,8 @@ import ( "sync" "time" - "github.com/percona/promconfig/alertmanager" "github.com/pkg/errors" "golang.org/x/sys/unix" - "gopkg.in/yaml.v3" pprofUtils "github.com/percona/pmm/managed/utils/pprof" "github.com/percona/pmm/utils/logger" @@ -149,23 +147,6 @@ func (l *Logs) files(ctx context.Context, pprofConfig *PprofConfig) []fileConten Err: err, }) } - for _, f := range []string{ - "/etc/alertmanager.yml", - "/srv/alertmanager/alertmanager.base.yml", - } { - b, m, err := readFile(f) - if err == nil { - b, err = maskAlertManagerSensitiveValues(b) - files = append(files, fileContent{ - Name: filepath.Base(f), - Modified: m, - Data: b, - Err: err, - }) - } else { - logger.Get(ctx).WithField("component", "logs").Error(err) - } - } // add configs for _, f := range []string{ "/etc/nginx/nginx.conf", @@ -443,16 +424,3 @@ func addAdminSummary(ctx context.Context, zw *zip.Writer) error { return nil } - -func maskAlertManagerSensitiveValues(data []byte) ([]byte, error) { - var c alertmanager.Config - err := yaml.Unmarshal(data, &c) - if err != nil { - return data, err - } - nc, err := c.Mask() - if err != nil { - return data, err - } - return yaml.Marshal(nc) -} diff --git a/managed/services/supervisord/logs_test.go b/managed/services/supervisord/logs_test.go index ebdf0f78f6..b4b8bffcee 100644 --- a/managed/services/supervisord/logs_test.go +++ b/managed/services/supervisord/logs_test.go @@ -36,10 +36,8 @@ import ( ) var commonExpectedFiles = []string{ - "alertmanager.base.yml", "alertmanager.ini", "alertmanager.log", - "alertmanager.yml", "clickhouse-server.log", "grafana.log", "installed.json",