Clearer documentation and comments for enabling Prometheus support

pull/4016/head
Pierre Souchay 7 years ago
parent 27362320e8
commit a680c8e91b

@ -425,7 +425,10 @@ type RuntimeConfig struct {
// hcl: telemetry { dogstatsd_tags = []string }
TelemetryDogstatsdTags []string
// PrometheusRetentionTime enables prometheus Support for metrics if greater than 0
// PrometheusRetentionTime is the retention time for prometheus metrics if greater than 0.
// A value of 0 disable Prometheus support. Regarding Prometheus, it is considered a good
// practice to put large values here (such as a few days), and at least the interval between
// prometheus requests.
//
// hcl: telemetry { prometheus_retention_time = "duration" }
TelemetryPrometheusRetentionTime time.Duration

@ -1332,8 +1332,11 @@ Consul will not enable TLS for the HTTP API unless the `https` port has been ass
* <a name="telemetry-prometheus_retention_time"></a><a href="telemetry-prometheus_retention_time">prometheus_retention_time</a>
If the value is greater than `0s` (the default), this enables [Prometheus](https://prometheus.io/) export of metrics.
The duration can be expressed using the duration semantics and will aggregates all counters for the duration specified
(it might have an impact on Consul's memory usage).
Fetching the metrics using prometheus can then be performed using the `/v1/agent/metrics?format=prometheus`.
(it might have an impact on Consul's memory usage). A good value for this parameter is at least 2 times the interval of scrape
of Prometheus, but you might also put a very high retention time such as a few days (for instance 744h to enable retention
to 31 days).
Fetching the metrics using prometheus can then be performed using the `/v1/agent/metrics?format=prometheus` URL or by sending
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
<a href="#telemetry-disable_hostname">`disable_hostname`</a> to avoid having prefixed metrics with hostname.

Loading…
Cancel
Save