Documentation ¶
Overview ¶
Package reloader contains helpers to trigger reloads of Prometheus instances on configuration changes and to substitute environment variables in config files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
func New(logger log.Logger, reloadURL *url.URL, cfgFile string, cfgEnvsubstFile string, ruleDir string) *Reloader
New creates a new reloader that watches the given config file and rule directory and triggers a Prometheus reload upon changes. If cfgEnvsubstFile is not empty, environment variables in the config file will be substituted and the out put written into the given path. Prometheus should then use cfgEnvsubstFile as its config file path.