diff --git a/website/source/api/agent.html.md b/website/source/api/agent.html.md index 0ea8af64e2..8bbe808759 100644 --- a/website/source/api/agent.html.md +++ b/website/source/api/agent.html.md @@ -237,14 +237,19 @@ $ curl \ This endpoint returns the configuration and member information of the local agent. -| Method | Path | Produces | -| ------ | ---------------------------- | -------------------------- | -| `GET` | `/agent/metrics` | `application/json` | +| Method | Path | Produces | +| ------ | ---------------------------------- | ------------------------------------------ | +| `GET` | `/agent/metrics` | `application/json` | +| `GET` | `/agent/metrics?format=prometheus` | `text/plain; version=0.0.4; charset=utf-8` | This endpoint will dump the metrics for the most recent finished interval. For more information about metrics, see the [telemetry](/docs/agent/telemetry.html) page. +In order to enable [Prometheus](https://prometheus.io/) support, you need to use the +configuration directive +[`prometheus_retention_time`](/docs/agent/options.html#telemetry-prometheus_retention_time). + | Blocking Queries | Consistency Modes | ACL Required | | ---------------- | ----------------- | ------------ | | `NO` | `none` | `agent:read` | diff --git a/website/source/docs/agent/options.html.md b/website/source/docs/agent/options.html.md index 0dcf866e2e..13e4a9c6ee 100644 --- a/website/source/docs/agent/options.html.md +++ b/website/source/docs/agent/options.html.md @@ -1329,6 +1329,14 @@ Consul will not enable TLS for the HTTP API unless the `https` port has been ass is overlap between two rules, the more specific rule will take precedence. Blocking will take priority if the same prefix is listed multiple times. + * prometheus_retention_time + 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`. + The format is compatible natively with prometheus. When running in this mode, it is recommended to also enable the option + `disable_hostname` to avoid having prefixed metrics with hostname. + * `enable_deprecated_names` Added in Consul 1.0, this enables old metric names of the format `consul.consul...` to be sent alongside other metrics. Defaults to false. diff --git a/website/source/docs/agent/telemetry.html.md b/website/source/docs/agent/telemetry.html.md index c0de0644c4..aba85a76a0 100644 --- a/website/source/docs/agent/telemetry.html.md +++ b/website/source/docs/agent/telemetry.html.md @@ -23,7 +23,8 @@ Additionally, if the [`telemetry` configuration options](/docs/agent/options.htm are provided, the telemetry information will be streamed to a [statsite](http://github.com/armon/statsite) or [statsd](http://github.com/etsy/statsd) server where it can be aggregated and flushed to Graphite or any other metrics store. This -information can also be viewed with the [metrics endpoint](/api/agent.html#view-metrics) +information can also be viewed with the [metrics endpoint](/api/agent.html#view-metrics) in JSON +format or using [Prometheus](https://prometheus.io/) format. Below is sample output of a telemetry dump: