Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reloader ¶
type Reloader struct {
// contains filtered or unexported fields
}
Reloader can watch config files and trigger reloads of a Prometheus server. It optionally substitutes environment variables in the configuration. Referenced environment variables must be of the form `$(var)` (not `$var` or `${var}`).
func New ¶
New creates a new reloader that watches the given config file or directory and does HTTP POST.
func (*Reloader) Watch ¶
Watch starts to watch periodically the config file and rules and process them until the context gets canceled. Config file gets env expanded if cfgOutputFile is specified and reload is trigger if config or rules changed. Watch watchers periodically based on r.watchInterval. For config file it watches it directly as well via fsnotify. It watches rule dirs as well, but lot's of edge cases are missing, so rely on interval mostly.
func (*Reloader) WithWatchInterval ¶
We cannot detect everything via watch. Watch interval controls how often we re-read given dirs non-recursively.