Better sub inputs handling (#193)

* Support for sub_inputs in extra plugins

* fix: properly handle lists as TOML arrays

- Updated the Jinja template to detect and serialize lists using |to_json,
  ensuring Telegraf interprets them correctly (e.g. names = ["item1","item2"]).
- Removed fallback logic for single items, so we consistently treat all sub_input
  values as lists of dictionaries.

---------

Co-authored-by: Michał Lisowski <mlisowski@sentient.ie>
This commit is contained in:
Michał Lisowski
2025-02-07 18:54:09 +01:00
committed by GitHub
parent 0c7f32937f
commit 4803b33f89
2 changed files with 13 additions and 7 deletions

View File

@ -342,13 +342,13 @@ sqs:
- statistic_include = ["average"]
sub_inputs:
metrics:
- names = [
- names: [
"ApproximateAgeOfOldestMessage",
"ApproximateNumberOfMessagesVisible",
]
metrics.dimensions:
- name = "QueueName"
- value = "*"
- name: "QueueName"
value: "*"
```
## Dependencies