mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-29 08:57:18 +02:00
config: allow reloading of telemetry settings (#1255)
* metrics: support dynamic configuration settings * add test * trace: update configuration when settings change * config: allow logging options to be configured when settings change * envoy: allow changing log settings * fix unexpected doc change * fix tests * pick a port at random * update based on review
This commit is contained in:
parent
0d611c2a40
commit
f822c9a5d2
20 changed files with 538 additions and 266 deletions
|
@ -55,6 +55,7 @@ type Source interface {
|
|||
// A StaticSource always returns the same config. Useful for testing.
|
||||
type StaticSource struct {
|
||||
cfg *Config
|
||||
lis []ChangeListener
|
||||
}
|
||||
|
||||
// NewStaticSource creates a new StaticSource.
|
||||
|
@ -67,8 +68,18 @@ func (src *StaticSource) GetConfig() *Config {
|
|||
return src.cfg
|
||||
}
|
||||
|
||||
// SetConfig sets the config.
|
||||
func (src *StaticSource) SetConfig(cfg *Config) {
|
||||
src.cfg = cfg
|
||||
for _, li := range src.lis {
|
||||
li(cfg)
|
||||
}
|
||||
}
|
||||
|
||||
// OnConfigChange is ignored for the StaticSource.
|
||||
func (src *StaticSource) OnConfigChange(ChangeListener) {}
|
||||
func (src *StaticSource) OnConfigChange(li ChangeListener) {
|
||||
src.lis = append(src.lis, li)
|
||||
}
|
||||
|
||||
// A FileOrEnvironmentSource retrieves config options from a file or the environment.
|
||||
type FileOrEnvironmentSource struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue