From 6f323eea64dba1bbf7d5917fde30eb080f778964 Mon Sep 17 00:00:00 2001 From: Joshua Powers Date: Thu, 12 Jan 2023 08:36:26 -0700 Subject: [PATCH] docs(inputs.influxdb): Collect v2 with prometheus plugin (#12492) --- plugins/inputs/influxdb/README.md | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/plugins/inputs/influxdb/README.md b/plugins/inputs/influxdb/README.md index fe1613b07..e6a29de78 100644 --- a/plugins/inputs/influxdb/README.md +++ b/plugins/inputs/influxdb/README.md @@ -1,13 +1,29 @@ # InfluxDB Input Plugin -The InfluxDB plugin will collect metrics on the given InfluxDB servers. Read -our [documentation][1] for detailed information about `influxdb` metrics. +The InfluxDB plugin will collect metrics on the given InfluxDB v1 servers from +the `/debug/vars` endpoint. Read the [documentation][1] for detailed +information about `influxdb` metrics. For InfluxDB v2 and the `metrics` +endpoint please see the section below. This plugin can also gather metrics from endpoints that expose InfluxDB-formatted endpoints. See below for more information. [1]: https://docs.influxdata.com/platform/monitoring/influxdata-platform/tools/measurements-internal/ +## InfluxDB v2 Metrics + +For [InfluxDB v2 metrics][2] are produced in Prometheus plain-text format. To +collect metrics at the new `/metrics` endpoint, please use the Prometheus +input plugin. This is an example to collect from a local database: + +```toml +[[inputs.prometheus]] + urls = ["http://localhost:8086/metrics"] + metric_version = 1 +``` + +[2]: https://docs.influxdata.com/influxdb/latest/reference/internals/metrics/ + ## Global configuration options In addition to the plugin-specific configuration settings, plugins support @@ -47,7 +63,7 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details. timeout = "5s" ``` -## Measurements & Fields +## Metrics **Note:** The measurements and fields included in this plugin are dynamically built from the InfluxDB source, and may vary between versions: