MSP-8299 vendor update
This commit is contained in:
1 parent
c8e4a014a0
commit
59d487646c
607 files changed
+48706
-13176
No files matched your search
+17
@@ -34,6 +34,9 @@ const (
|
||||
defaultEnableLogSampling = false
|
||||
defaultMaxLogSamplingPerSecond = 1000
|
||||
defaulLogSamplingPassEvery = 100
|
||||
|
||||
defaultLogSplitEnabled = false
|
||||
defaultLogSplitMaxLineKb = log.DefaultMaxLineKb
|
||||
)
|
||||
|
||||
// BaseBootstrap provides the core initialization context for all application types.
|
||||
@@ -265,11 +268,25 @@ func appConfig(isDev bool) (*app.Config, error) {
|
||||
}
|
||||
}
|
||||
|
||||
var split *log.SplitConfig
|
||||
isSplitEnabled := cfg.Optional().Bool("LOGS.SPLIT.ENABLE", defaultLogSplitEnabled)
|
||||
if !isDev && isSplitEnabled {
|
||||
maxLineKb := cfg.Optional().Int("LOGS.SPLIT.MAXLINEKB", defaultLogSplitMaxLineKb)
|
||||
if maxLineKb <= 0 {
|
||||
maxLineKb = defaultLogSplitMaxLineKb
|
||||
}
|
||||
split = &log.SplitConfig{
|
||||
Enabled: true,
|
||||
MaxLineKb: maxLineKb,
|
||||
}
|
||||
}
|
||||
|
||||
return log.Config{
|
||||
IsInDevMode: isDev,
|
||||
OutputPaths: outputPaths,
|
||||
Sampling: sampling,
|
||||
InitialLevel: initialLevel,
|
||||
Split: split,
|
||||
Hooks: []func(entry zapcore.Entry) error{
|
||||
logCounter.SampledLogCounter(),
|
||||
},
|
||||
|
||||
+1
@@ -308,6 +308,7 @@ func initClusterClient(
|
||||
},
|
||||
EndpointsResolver: endpointsResolver,
|
||||
MetricsAutodiscovery: metricsServiceDiscovery(localConfig, broadcastHost),
|
||||
ModuleLeaderMode: localConfig.ModuleLeaderMode,
|
||||
}
|
||||
|
||||
schema := rc.GenerateConfigSchema(remoteConfig)
|
||||
|
||||
+10
-2
@@ -11,7 +11,7 @@ import "time"
|
||||
// - MigrationsDirPath: Path to database migrations directory (optional)
|
||||
// - RemoteConfigOverride: Override content for remote configuration (optional)
|
||||
// - LogFile: File-based logging configuration
|
||||
// - Logs: Log sampling and rate limiting configuration
|
||||
// - Logs: Log sampling and splitting configuration
|
||||
// - Observability: Sentry and tracing configuration
|
||||
// - InfraServerPort: Custom port for infrastructure server (optional, defaults to GrpcInnerAddress.Port + 1)
|
||||
// - HealthcheckHandlerTimeout: Timeout for health check requests
|
||||
@@ -41,6 +41,7 @@ type LocalConfig struct {
|
||||
// - DefaultRemoteConfigPath: Custom path for default remote configuration file (optional)
|
||||
// - RemoteConfigReceiverTimeout: Timeout for receiving remote configuration updates
|
||||
// - MetricsAutodiscovery: Configuration for Prometheus metrics auto-discovery
|
||||
// - ModuleLeaderMode: Module leader election mode announced in MODULE:READY (optional)
|
||||
type ClusteredLocalConfig struct {
|
||||
LocalConfig
|
||||
|
||||
@@ -48,20 +49,27 @@ type ClusteredLocalConfig struct {
|
||||
DefaultRemoteConfigPath string
|
||||
RemoteConfigReceiverTimeout time.Duration
|
||||
MetricsAutodiscovery MetricsAutodiscovery
|
||||
ModuleLeaderMode string
|
||||
}
|
||||
|
||||
// Logs configures log sampling and rate limiting.
|
||||
// Logs configures log sampling and splitting.
|
||||
//
|
||||
// Fields:
|
||||
// - Sampling.Enable: Enable log sampling to prevent log flooding
|
||||
// - Sampling.MaxPerSecond: Maximum log entries per second when sampling is enabled
|
||||
// - Sampling.PassEvery: Number of log entries to pass before sampling again
|
||||
// - Split.Enable: Split JSON log records bigger than the limit into parts (default: false, disabled)
|
||||
// - Split.MaxLineKb: Size of one part in kilobytes (default: 218)
|
||||
type Logs struct {
|
||||
Sampling struct {
|
||||
Enable bool
|
||||
MaxPerSecond int
|
||||
PassEvery int
|
||||
}
|
||||
Split struct {
|
||||
Enable bool
|
||||
MaxLineKb int
|
||||
}
|
||||
}
|
||||
|
||||
// LogFile configures file-based logging output.
|
||||
|
||||
Reference in new issue
Block a user