Added explainations on how having a working configuration for Prometheus (#4397)

* Added explainations on how having a working configuration for Prometheus

Since Prometheus escapes by default query parameters, this paragraph explains
how having `format=prometheus` to be taken into account by prometheus.

* Rephrase Prometheus notes in documentation as requested by @pearkes
pull/4469/head
Pierre Souchay 2018-07-26 01:17:38 +02:00 committed by Jack Pearkes
parent 667ac22f71
commit 3959a91e43
1 changed files with 8 additions and 0 deletions

View File

@ -1220,6 +1220,14 @@ Consul will not enable TLS for the HTTP API unless the `https` port has been ass
the Accept header with value `text/plain; version=0.0.4; charset=utf-8` to the `/v1/agent/metrics` (as done by Prometheus). the Accept header with value `text/plain; version=0.0.4; charset=utf-8` to the `/v1/agent/metrics` (as done by Prometheus).
The format is compatible natively with prometheus. When running in this mode, it is recommended to also enable the option The format is compatible natively with prometheus. When running in this mode, it is recommended to also enable the option
<a href="#telemetry-disable_hostname">`disable_hostname`</a> to avoid having prefixed metrics with hostname. <a href="#telemetry-disable_hostname">`disable_hostname`</a> to avoid having prefixed metrics with hostname.
Consul does not use the default Prometheus path, so Prometheus must be configured as follows.
Note that using ?format=prometheus in the path won't work as ? will be escaped, so it must be specified as a parameter.
```yaml
metrics_path: "/v1/agent/metrics"
params:
format: ['prometheus']
```
* <a name="telemetry-statsd_address"></a><a href="#telemetry-statsd_address">`statsd_address`</a> This provides the * <a name="telemetry-statsd_address"></a><a href="#telemetry-statsd_address">`statsd_address`</a> This provides the
address of a statsd instance in the format `host:port`. If provided, Consul will send various telemetry information to that instance for address of a statsd instance in the format `host:port`. If provided, Consul will send various telemetry information to that instance for