From 389c5380ed8cf6507d5b6fd4d6c5a1cdfdfbdf2f Mon Sep 17 00:00:00 2001 From: Samantha Wang <32681364+sjwang90@users.noreply.github.com> Date: Wed, 19 Aug 2020 16:24:58 -0700 Subject: [PATCH] Fix configuration.md formatting (#7965) * fix configuration.md formatting * include cloud url comments --- docs/CONFIGURATION.md | 46 ++++++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md index 2bd5ca3d9..7826da3be 100644 --- a/docs/CONFIGURATION.md +++ b/docs/CONFIGURATION.md @@ -45,6 +45,7 @@ in the `/etc/default/telegraf` file. **Example**: `/etc/default/telegraf`: + For InfluxDB 1.x: ``` USER="alice" @@ -53,18 +54,22 @@ INFLUX_SKIP_DATABASE_CREATION="true" INFLUX_PASSWORD="monkey123" ``` For InfluxDB OSS 2: +``` INFLUX_HOST="http://localhost:9999" -INFLUX_TOKEN=”replace_with_your_token” +INFLUX_TOKEN="replace_with_your_token" INFLUX_ORG="your_username" INFLUX_BUCKET="replace_with_your_bucket_name" +``` For InfluxDB Cloud 2: -# For AWS Oregon: +``` +# For AWS West (Oregon) INFLUX_HOST="https://us-west-2-1.aws.cloud2.influxdata.com" # Other Cloud URLs at https://v2.docs.influxdata.com/v2.0/reference/urls/#influxdb-cloud-urls INFLUX_TOKEN=”replace_with_your_token” INFLUX_ORG="yourname@yourcompany.com" INFLUX_BUCKET="replace_with_your_bucket_name" +``` `/etc/telegraf.conf`: ```toml @@ -73,10 +78,25 @@ INFLUX_BUCKET="replace_with_your_bucket_name" [[inputs.mem]] +# For InfluxDB 1.x: [[outputs.influxdb]] urls = ["${INFLUX_URL}"] skip_database_creation = ${INFLUX_SKIP_DATABASE_CREATION} password = "${INFLUX_PASSWORD}" + +# For InfluxDB OSS 2: +[[outputs.influxdb_v2]] + urls = ["${INFLUX_HOST}"] + token = ["${INFLUX_TOKEN}"] + org = ["${INFLUX_ORG}"] + bucket = ["${INFLUX_BUCKET}"] + +# For InfluxDB Cloud 2: +[[outputs.influxdb_v2]] + urls = ["${INFLUX_HOST}"] + token = ["${INFLUX_TOKEN}"] + org = ["${INFLUX_ORG}"] + bucket = ["${INFLUX_BUCKET}"] ``` The above files will produce the following effective configuration file to be @@ -85,6 +105,8 @@ parsed: [global_tags] user = "alice" +[[inputs.mem]] + # For InfluxDB 1.x: [[outputs.influxdb]] urls = "http://localhost:8086" @@ -93,19 +115,19 @@ parsed: # For InfluxDB OSS 2: [[outputs.influxdb_v2]] -urls = ["http://127.0.0.1:9999"] -token = "replace_with_your_token" -org = "your_username" -bucket = "replace_with_your_bucket_name" + urls = ["http://127.0.0.1:9999"] + token = "replace_with_your_token" + org = "your_username" + bucket = "replace_with_your_bucket_name" # For InfluxDB Cloud 2: [[outputs.influxdb_v2]] -# For AWS Oregon: -urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"] -# Other Cloud URLs at https://v2.docs.influxdata.com/v2.0/reference/urls/#influxdb-cloud-urls -token = "replace_with_your_token" -org = "yourname@yourcompany.com" -bucket = "replace_with_your_bucket_name" + # For AWS West (Oregon) + INFLUX_HOST="https://us-west-2-1.aws.cloud2.influxdata.com" + # Other Cloud URLs at https://v2.docs.influxdata.com/v2.0/reference/urls/#influxdb-cloud-urls + token = "replace_with_your_token" + org = "yourname@yourcompany.com" + bucket = "replace_with_your_bucket_name" ``` ### Intervals