From 1f14a553393bf69b9d98b9151271a8ea54199ec9 Mon Sep 17 00:00:00 2001 From: Maciek Sakrejda Date: Tue, 3 Sep 2024 17:18:07 -0700 Subject: [PATCH] Drop supported log_line_prefix check in test (#593) * Avoid log_line_prefix check in log test in new mode * Drop obsolete TODO --- config/config.go | 1 - runner/logs.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/config/config.go b/config/config.go index dfdcf5b5e..f8ede4319 100644 --- a/config/config.go +++ b/config/config.go @@ -175,7 +175,6 @@ type ServerConfig struct { // Configure the collector's log parsing mechanism. Can be either 'legacy' (to // use the old mechanism), or 'auto' (a new mechanism that can support an // arbitrary log_line_prefix). - // TODO: analyze and mention (hopefully beneficial) performance impact LogLinePrefix string `init:"db_log_line_prefix"` // Specifies a table pattern to ignore - no statistics will be collected for diff --git a/runner/logs.go b/runner/logs.go index 8311f3d0b..ee4fd68ad 100644 --- a/runner/logs.go +++ b/runner/logs.go @@ -388,7 +388,7 @@ func TestLogsForAllServers(ctx context.Context, servers []*state.Server, globalC } else if server.Config.SystemType == "heroku" && logLinePrefix == logs.LogPrefixHerokuHobbyTier { prefixedLogger.PrintWarning("WARNING - Detected log_line_prefix indicates Heroku Postgres Hobby tier, which has no log output support") continue - } else if !logs.IsSupportedPrefix(logLinePrefix) { + } else if server.Config.LogLinePrefix == "legacy" && !logs.IsSupportedPrefix(logLinePrefix) { prefixedLogger.PrintError("ERROR - Unsupported log_line_prefix setting: '%s'", logLinePrefix) prefixedLogger.PrintInfo("HINT - You can find a list of supported settings in the pganalyze documentation: https://pganalyze.com/docs/log-insights/setup/self-managed/troubleshooting") hasFailedServers = true