mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-12 08:37:38 +02:00
core/config: add config version, additional telemetry (#4645)
* core/config: add config version, additional telemetry * typo
This commit is contained in:
parent
dd7e3b993c
commit
ae420f01c6
13 changed files with 857 additions and 766 deletions
|
@ -114,6 +114,7 @@ func NewFileOrEnvironmentSource(
|
|||
cfg := &Config{
|
||||
Options: options,
|
||||
EnvoyVersion: envoyVersion,
|
||||
Version: 1,
|
||||
}
|
||||
|
||||
ports, err := netutil.AllocatePorts(6)
|
||||
|
@ -151,6 +152,7 @@ func (src *FileOrEnvironmentSource) check(ctx context.Context) {
|
|||
options, err := newOptionsFromConfig(src.configFile)
|
||||
if err == nil {
|
||||
cfg = cfg.Clone()
|
||||
cfg.Version++
|
||||
cfg.Options = options
|
||||
metrics.SetConfigInfo(ctx, cfg.Options.Services, "local", cfg.Checksum(), true)
|
||||
} else {
|
||||
|
@ -160,6 +162,8 @@ func (src *FileOrEnvironmentSource) check(ctx context.Context) {
|
|||
src.config = cfg
|
||||
src.mu.Unlock()
|
||||
|
||||
log.Info(ctx).Int64("config-version", cfg.Version).Msg("config: loaded configuration")
|
||||
|
||||
src.Trigger(ctx, cfg)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue