Monitoring Petals ESB with Prometheus

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (2)

View Page History
h1. *Configuring Prometheus*

h2. Configuration file

Prometheus can be configured to connect statically or dynamically to metrics sources, these configurations are under the *scrape_configs* section of the yaml config file.
Depending on how you manage you machines, Prometheus can be connecter dynamically to several services systems including: Azure, Consul, EC2, OpenStack, GCE, Kubernetes, Marathon, AirBnB's Nerve, Zookeeper Serverset, Triton.

More information on ??[Prometheus documentation|https://prometheus.io/docs/prometheus/latest/configuration/configuration/]

h2. Reload configuration

If the scraping configuration is not set dynamically, you can change the configuration and make Prometheus reload the file.

h3. Remote command

There are two ways to ask Prometheus to reload it's configuration remotely:

Send a *SIGHUP*: determine the [process id|https://www.digitalocean.com/community/tutorials/how-to-use-ps-kill-and-nice-to-manage-processes-in-linux] of Prometheus (look in _'var/run/prometheus.pid'_, or use tools as '_pgrep'_, '_ps aux \| grep prometheus'_). Then use the kill command to send the signal:

{code}kill -HUP 1234{code}

Or, send a *HTTP POST* to the Prometheus web server _'/-/reload'_ handler:

{code}curl -X POST http://localhost:9090/-/reload{code}

Note: as of Prometheus 2.0, to reload over HTTP the_ '--web.enable-lifecycle'_ command line flag must be set.

In any case, Prometheus should acknowledge the reload:
{code}
level=info ts=2018-10-01T14:57:17.292032129Z caller=main.go:624 msg="Loading configuration file" filename=prometheus.yml
level=info ts=2018-10-01T14:57:17.293868363Z caller=main.go:650 msg="Completed loading of configuration file" filename=prometheus.yml
{code}

h3. File configuration

A mentioned in the [documentation on file configuration|https://prometheus.io/docs/prometheus/latest/configuration/configuration/#%3Cfile_sd_config%3E]
{quote}
Changes to all defined files are detected via disk watches and applied immediately. Files may be provided in YAML or JSON format. Only changes resulting in well-formed target groups are applied.
[]
As a fallback, the file contents are also re-read periodically at the specified refresh interval.
{quote}