From d73d3cbc4a82e59fd3c3ea2c7996cfbf13f88e17 Mon Sep 17 00:00:00 2001 From: Jason Stirnaman Date: Fri, 1 May 2026 09:43:47 -0500 Subject: [PATCH] docs: fix code-block lint errors across plugin READMEs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit InfluxData docs-v2 added a parse/compile lint check for fenced code blocks. JSON, YAML, and TOML blocks that fail to parse block CI on the docs site. The plugin READMEs in this repo are mirrored verbatim into docs-v2 by the sync process, so several blocks that were never valid JSON or TOML now break the docs build downstream. These fixes preserve the original intent and content where possible. Where a block is genuinely illustrative (placeholders, ellipses, mixed HTTP-method-line plus body, vendor query languages) the fence is relabeled to the closer-fit language so the lint check skips it. TOML fixes (6 files): - inputs/jti_openconfig_telemetry: `sensors = [...]` was redefined twice; commented out the alternative-form example. - inputs/opcua_listener: `// ... default values ...` C-style comments inside an inline-table list. TOML uses `#` for comments; converted to trailing `#` comments. - inputs/postgresql_extensible: `sqlquery = "...where \` line continuations in basic strings are invalid TOML. Switched to multi-line basic strings (`"""..."""`) which preserve the `\` line-end continuation form for readability and parse cleanly per the TOML 1.0 spec (`mlBasicBody <- ... / escape newline wsnl` in influxdata/toml's parse.peg). - inputs/win_eventlog: `xpath_query = '''` opened a TOML literal multi-line string but never closed; the surrounding text says "set xpath_query empty" — replaced with `""`. - outputs/dynatrace: `api_token = "..." // hard-coded ...` — converted `//` to `#`. - processors/converter: `timestamp_format = "unix` missing close quote. JSON fixes (8 files): - inputs/bind: BIND nameserver config (`statistics-channels { ... };`) was tagged `json`. Relabeled `text`. - inputs/ctrlx_datalayer (3 blocks): `"key" : value` lines (the OPC UA server's address-value rendering) are not JSON. Relabeled `text`. - inputs/docker (2 blocks): `docker_label_exclude = [...]` and `docker_label_include = [...]` are TOML config snippets, not JSON. Relabeled `toml`. - outputs/azure_data_explorer: KQL function definition (`.create-or- alter function ... { ... }`) tagged `json`. Relabeled `kusto`. - outputs/clarify: `"signal" { ... }` and `"values" { ... }` are Clarify's representation, not JSON. Relabeled `text`. - outputs/elasticsearch (2 blocks): `PUT /_cluster/settings` and `POST https://...` are HTTP request lines mixed with a JSON body. Relabeled `text`. - outputs/zabbix (2 blocks): line-delimited multiple JSON objects. Relabeled `jsonl`. - processors/lookup: illustrative template with `...` ellipsis relabeled `text`; the actual data block had a trailing comma that was removed. No code or behavior changes — README content only. --- plugins/inputs/bind/README.md | 2 +- plugins/inputs/ctrlx_datalayer/README.md | 6 +++--- plugins/inputs/docker/README.md | 4 ++-- plugins/inputs/jti_openconfig_telemetry/README.md | 13 +++++++------ plugins/inputs/opcua_listener/README.md | 6 +++--- plugins/inputs/postgresql_extensible/README.md | 15 +++++++++------ plugins/inputs/win_eventlog/README.md | 2 +- plugins/outputs/azure_data_explorer/README.md | 2 +- plugins/outputs/clarify/README.md | 2 +- plugins/outputs/dynatrace/README.md | 2 +- plugins/outputs/elasticsearch/README.md | 4 ++-- plugins/outputs/zabbix/README.md | 4 ++-- plugins/processors/converter/README.md | 2 +- plugins/processors/lookup/README.md | 4 ++-- 14 files changed, 36 insertions(+), 32 deletions(-) diff --git a/plugins/inputs/bind/README.md b/plugins/inputs/bind/README.md index cf3150ab8c637..b4f47cc9c692d 100644 --- a/plugins/inputs/bind/README.md +++ b/plugins/inputs/bind/README.md @@ -71,7 +71,7 @@ depending on your BIND version and configured statistics channel. Add the following to your named.conf if running Telegraf on the same host as the BIND daemon: -```json +```text statistics-channels { inet 127.0.0.1 port 8053; }; diff --git a/plugins/inputs/ctrlx_datalayer/README.md b/plugins/inputs/ctrlx_datalayer/README.md index 8d505c3e799d1..326fd38851158 100644 --- a/plugins/inputs/ctrlx_datalayer/README.md +++ b/plugins/inputs/ctrlx_datalayer/README.md @@ -309,7 +309,7 @@ Configuration: Source: -```json +```text "framework/metrics/system/memavailable-mb" : 365.93359375 "framework/metrics/system/memused-mb" : 567.67578125 ``` @@ -336,7 +336,7 @@ Configuration: Source: -```json +```text "alldata/dynamic/array-of-bool8" : [true, false, true] "alldata/dynamic/array-of-uint8" : [0, 255] ``` @@ -363,7 +363,7 @@ Configuration: Source: -```json +```text "motion/axs/Axis_1/state/values/actual" : {"actualPos":65.249329860957,"actualVel":5,"actualAcc":0,"actualTorque":0,"distLeft":0,"actualPosUnit":"mm","actualVelUnit":"mm/min","actualAccUnit":"m/s^2","actualTorqueUnit":"Nm","distLeftUnit":"mm"} "motion/axs/Axis_2/state/values/actual" : {"actualPos":120,"actualVel":0,"actualAcc":0,"actualTorque":0,"distLeft":0,"actualPosUnit":"deg","actualVelUnit":"rpm","actualAccUnit":"rad/s^2","actualTorqueUnit":"Nm","distLeftUnit":"deg"} ``` diff --git a/plugins/inputs/docker/README.md b/plugins/inputs/docker/README.md index eac633b06bd63..dd744bae45087 100644 --- a/plugins/inputs/docker/README.md +++ b/plugins/inputs/docker/README.md @@ -158,7 +158,7 @@ for containers that have no explicit hostname set, as defined by docker. Kubernetes may add many labels to your containers, if they are not needed you may prefer to exclude them: -```json +```toml docker_label_exclude = ["annotation.kubernetes*"] ``` @@ -167,7 +167,7 @@ may prefer to exclude them: Docker-compose will add labels to your containers. You can limit restrict labels to selected ones, e.g. -```json +```toml docker_label_include = [ "com.docker.compose.config-hash", "com.docker.compose.container-number", diff --git a/plugins/inputs/jti_openconfig_telemetry/README.md b/plugins/inputs/jti_openconfig_telemetry/README.md index 432bd3a24a345..826534b7c7bb9 100644 --- a/plugins/inputs/jti_openconfig_telemetry/README.md +++ b/plugins/inputs/jti_openconfig_telemetry/README.md @@ -60,12 +60,13 @@ plugin ordering. See [CONFIGURATION.md][CONFIGURATION.md] for more details. ## We allow specifying sensor group level reporting rate. To do this, specify the ## reporting rate in Duration at the beginning of sensor paths / collection - ## name. For entries without reporting rate, we use configured sample frequency - sensors = [ - "1000ms customReporting /interfaces /lldp", - "2000ms collection /components", - "/interfaces", - ] + ## name. For entries without reporting rate, we use configured sample frequency. + ## Use this form INSTEAD of the simple `sensors` list above: + # sensors = [ + # "1000ms customReporting /interfaces /lldp", + # "2000ms collection /components", + # "/interfaces", + # ] ## Timestamp Source ## Set to 'collection' for time of collection, and 'data' for using the time diff --git a/plugins/inputs/opcua_listener/README.md b/plugins/inputs/opcua_listener/README.md index 2154c3479c077..5d8a1d6dd86c6 100644 --- a/plugins/inputs/opcua_listener/README.md +++ b/plugins/inputs/opcua_listener/README.md @@ -538,9 +538,9 @@ This example group configuration shows how to use group settings: identifier = "5678" node_ids = [ - {identifier="Sensor1"}, // default values will be used for namespace and identifier_type - {namespace="2", identifier="TemperatureSensor"}, // default values will be used for identifier_type - {namespace="5", identifier_type="i", identifier="2002"} // no default values will be used + {identifier="Sensor1"}, # default values will be used for namespace and identifier_type + {namespace="2", identifier="TemperatureSensor"}, # default values will be used for identifier_type + {namespace="5", identifier_type="i", identifier="2002"} # no default values will be used ] ``` diff --git a/plugins/inputs/postgresql_extensible/README.md b/plugins/inputs/postgresql_extensible/README.md index 244de9584b84e..4fcc22f26c791 100644 --- a/plugins/inputs/postgresql_extensible/README.md +++ b/plugins/inputs/postgresql_extensible/README.md @@ -131,8 +131,9 @@ using the postgresql extensions [pg_stat_statements][pg_stat_statements], withdbname=false tagvalue="db,username,state" [[inputs.postgresql_extensible.query]] - sqlquery="select setting as max_connections from pg_settings where \ - name='max_connections'" + sqlquery="""\ + select setting as max_connections from pg_settings where \ + name='max_connections'""" version=801 withdbname=false tagvalue="" @@ -142,15 +143,17 @@ using the postgresql extensions [pg_stat_statements][pg_stat_statements], withdbname=false tagvalue="" [[inputs.postgresql_extensible.query]] - sqlquery="select setting as shared_buffers from pg_settings where \ - name='shared_buffers'" + sqlquery="""\ + select setting as shared_buffers from pg_settings where \ + name='shared_buffers'""" version=801 withdbname=false tagvalue="" [[inputs.postgresql_extensible.query]] - sqlquery="SELECT db, count( distinct blocking_pid ) AS num_blocking_sessions,\ + sqlquery="""\ + SELECT db, count( distinct blocking_pid ) AS num_blocking_sessions,\ count( distinct blocked_pid) AS num_blocked_sessions FROM \ - public.blocking_procs group by db" + public.blocking_procs group by db""" version=901 withdbname=false tagvalue="db" diff --git a/plugins/inputs/win_eventlog/README.md b/plugins/inputs/win_eventlog/README.md index a9a9f35e0078b..0cfef4a2f1ee9 100644 --- a/plugins/inputs/win_eventlog/README.md +++ b/plugins/inputs/win_eventlog/README.md @@ -137,7 +137,7 @@ There are three types of filtering: **Event Log** name, **XPath Query** and ```toml eventlog_name = "Application" - xpath_query = ''' + xpath_query = "" ``` For **XPath Query** filtering set the `xpath_query` value, and `eventlog_name` diff --git a/plugins/outputs/azure_data_explorer/README.md b/plugins/outputs/azure_data_explorer/README.md index 3cea985a0bba6..3641467bf3758 100644 --- a/plugins/outputs/azure_data_explorer/README.md +++ b/plugins/outputs/azure_data_explorer/README.md @@ -244,7 +244,7 @@ stored as dynamic data type, multiple ways to query this data- recommended performant way for querying over large volumes of data compared to querying directly over JSON attributes: - ```json + ```kusto // Function to transform data .create-or-alter function Transform_TargetTableName() { SourceTableName diff --git a/plugins/outputs/clarify/README.md b/plugins/outputs/clarify/README.md index 31fa1cfc58745..02673e2fc0fd2 100644 --- a/plugins/outputs/clarify/README.md +++ b/plugins/outputs/clarify/README.md @@ -68,7 +68,7 @@ The following input would be stored in Clarify with the values shown below: temperature,host=demo.clarifylocal,sensor=TC0P value=49 1682670910000000000 ``` -```json +```text "signal" { "id": "temperature.value.TC0P" "name": "temperature.value" diff --git a/plugins/outputs/dynatrace/README.md b/plugins/outputs/dynatrace/README.md index 63dfa79e361ba..a5a9a46baeddb 100644 --- a/plugins/outputs/dynatrace/README.md +++ b/plugins/outputs/dynatrace/README.md @@ -91,7 +91,7 @@ The endpoint for the Dynatrace Metrics API v2 is url = "https://{your-environment-id}.live.dynatrace.com/api/v2/metrics/ingest" ## API token is required if a URL is specified and should be restricted to the 'Ingest metrics' scope - api_token = "your API token here" // hard-coded for illustration only, should be read from environment + api_token = "your API token here" # hard-coded for illustration only, should be read from environment ``` You can learn more about how to use the [Dynatrace API][api]. diff --git a/plugins/outputs/elasticsearch/README.md b/plugins/outputs/elasticsearch/README.md index 1bfce4bfd3149..9c2961c24afd8 100644 --- a/plugins/outputs/elasticsearch/README.md +++ b/plugins/outputs/elasticsearch/README.md @@ -205,7 +205,7 @@ compatibility mode users need to set the `override_main_response_version` to On existing clusters run: -```json +```text PUT /_cluster/settings { "persistent" : { @@ -216,7 +216,7 @@ PUT /_cluster/settings And on new clusters set the option to true under advanced options: -```json +```text POST https://es.us-east-1.amazonaws.com/2021-01-01/opensearch/upgradeDomain { "DomainName": "domain-name", diff --git a/plugins/outputs/zabbix/README.md b/plugins/outputs/zabbix/README.md index fe9557db4bb19..e8458d3539f6d 100644 --- a/plugins/outputs/zabbix/README.md +++ b/plugins/outputs/zabbix/README.md @@ -174,7 +174,7 @@ measurement,host=hostname valueA=0,valueB=1 It will generate this Zabbix metrics: -```json +```jsonl {"host": "hostname", "key": "telegraf.measurement.valueA", "value": "0"} {"host": "hostname", "key": "telegraf.measurement.valueB", "value": "1"} ``` @@ -188,7 +188,7 @@ measurement,host=hostname,tagA=keyA,tagB=keyB valueA=0,valueB=1 Zabbix generated metrics: -```json +```jsonl {"host": "hostname", "key": "telegraf.measurement.valueA[keyA,keyB]", "value": "0"} {"host": "hostname", "key": "telegraf.measurement.valueB[keyA,keyB]", "value": "1"} ``` diff --git a/plugins/processors/converter/README.md b/plugins/processors/converter/README.md index 54e2f7cea1424..6b6dc7fe873cd 100644 --- a/plugins/processors/converter/README.md +++ b/plugins/processors/converter/README.md @@ -131,7 +131,7 @@ Set the metric timestamp from a tag: [[processors.converter]] [processors.converter.tags] timestamp = ["time"] - timestamp_format = "unix + timestamp_format = "unix" ``` ```diff diff --git a/plugins/processors/lookup/README.md b/plugins/processors/lookup/README.md index 6f133afc3b3f6..e13a0c13ce979 100644 --- a/plugins/processors/lookup/README.md +++ b/plugins/processors/lookup/README.md @@ -63,7 +63,7 @@ added to a metric if the key matches. In the `json` format, the input `files` must have the following format -```json +```text { "keyA": { "tag-name1": "tag-value1", @@ -133,7 +133,7 @@ With a lookup table of "xyzzy-red": { "location": "us-west", "rack": "C01-42" - }, + } } ```