prometheus restart needed when new target relations appear
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Prometheus2 charm |
New
|
Undecided
|
Unassigned |
Bug Description
Many times I do not see prometheus scraping the endpoints which have been provided via the target relation and which have been written to the config file /var/snap/
I will check the relation data is correct
$ juju run -u telegraf/<unit> "relation-get -r prometheus-
then check the config file
$ juju ssh prometheus/0 "cat /var/snap/
to find the IP and PORT of the target prometheus should scrape and it's in the config
But it requires the prometheus service to be restarted
$ juju run -u prometheus/0 "service snap.prometheus
Shouldn't this be done automatically when a new target relation is changed -- or at least anytime the config file is updated
In general Prometheus does not need to restart to reload its' config: "Prometheus can reload its configuration at runtime." https:/ /prometheus. io/docs/ prometheus/ latest/ configuration/ configuration/
A reload can be triggered via SIGHUP process signal or http request to '<ip>:< port>/- /reload' if prometheus runs with --web.enable- lifecycle.