Refactor disabling the stats logger

Have Snowflake proxy periodically collect throughput stats even if the
stats logger is disabled so that it can be handled by the prometheus
metrics.
This commit is contained in:
Cecylia Bocovich 2023-10-31 13:15:52 -04:00
parent 22d9381d9d
commit 648609dbea
No known key found for this signature in database
GPG key ID: 009DE379FD9B7B90
3 changed files with 17 additions and 14 deletions

View file

@ -97,8 +97,7 @@ func main() {
RelayDomainNamePattern: *allowedRelayHostNamePattern,
AllowNonTLSRelay: *allowNonTLSRelay,
DisableStatsLogger: *disableStatsLogger,
SummaryInterval: *summaryInterval,
SummaryInterval: *summaryInterval,
}
var logOutput = ioutil.Discard
@ -127,7 +126,7 @@ func main() {
log.SetOutput(&safelog.LogScrubber{Output: logOutput})
}
proxyEventLogger := sf.NewProxyEventLogger(eventlogOutput)
proxyEventLogger := sf.NewProxyEventLogger(eventlogOutput, *disableStatsLogger)
eventLogger.AddSnowflakeEventListener(proxyEventLogger)
if *enableMetrics {