chore: more visibility and debug lines for queues (#836)

* chore: more visibility and debug options for queues

* better debug lines on queue repo

* don't log so much in load test
This commit is contained in:
abelanger5
2024-08-29 14:49:24 -04:00
committed by GitHub
parent 96c040ebb7
commit b5014f6b3d
21 changed files with 1242 additions and 103 deletions
+18
View File
@@ -45,6 +45,8 @@ type ServerConfigFile struct {
Logger shared.LoggerConfigFile `mapstructure:"logger" json:"logger,omitempty"`
AdditionalLoggers ConfigFileAdditionalLoggers `mapstructure:"additionalLoggers" json:"additionalLoggers,omitempty"`
OpenTelemetry shared.OpenTelemetryConfigFile `mapstructure:"otel" json:"otel,omitempty"`
SecurityCheck SecurityCheckConfigFile `mapstructure:"securityCheck" json:"securityCheck,omitempty"`
@@ -54,6 +56,14 @@ type ServerConfigFile struct {
Email ConfigFileEmail `mapstructure:"email" json:"email,omitempty"`
}
type ConfigFileAdditionalLoggers struct {
// Queue is a custom logger config for the queue service
Queue shared.LoggerConfigFile `mapstructure:"queue" json:"queue,omitempty"`
// PgxStats is a custom logger config for the pgx stats service
PgxStats shared.LoggerConfigFile `mapstructure:"pgxStats" json:"pgxStats,omitempty"`
}
// General server runtime options
type ConfigFileRuntime struct {
// Port is the port that the core server listens on
@@ -339,6 +349,8 @@ type ServerConfig struct {
Logger *zerolog.Logger
AdditionalLoggers ConfigFileAdditionalLoggers
TLSConfig *tls.Config
SessionStore *cookie.UserSessionStore
@@ -480,6 +492,12 @@ func BindAllEnv(v *viper.Viper) {
_ = v.BindEnv("logger.level", "SERVER_LOGGER_LEVEL")
_ = v.BindEnv("logger.format", "SERVER_LOGGER_FORMAT")
// additional logger options
_ = v.BindEnv("additionalLoggers.queue.level", "SERVER_ADDITIONAL_LOGGERS_QUEUE_LEVEL")
_ = v.BindEnv("additionalLoggers.queue.format", "SERVER_ADDITIONAL_LOGGERS_QUEUE_FORMAT")
_ = v.BindEnv("additionalLoggers.pgxStats.level", "SERVER_ADDITIONAL_LOGGERS_PGXSTATS_LEVEL")
_ = v.BindEnv("additionalLoggers.pgxStats.format", "SERVER_ADDITIONAL_LOGGERS_PGXSTATS_FORMAT")
// otel options
_ = v.BindEnv("otel.serviceName", "SERVER_OTEL_SERVICE_NAME")
_ = v.BindEnv("otel.collectorURL", "SERVER_OTEL_COLLECTOR_URL")