mirror of
https://github.com/dj-wasabi/ansible-telegraf.git
synced 2025-07-17 08:46:37 +00:00
Input tags support
This commit is contained in:
@ -53,6 +53,8 @@ Specifying an output. The default is set to localhost, you'll have to specify th
|
|||||||
config:
|
config:
|
||||||
- urls = ["http://localhost:8086"]
|
- urls = ["http://localhost:8086"]
|
||||||
- database = "telegraf"
|
- database = "telegraf"
|
||||||
|
tagpass:
|
||||||
|
- diskmetrics = ["true"]
|
||||||
|
|
||||||
The config will be printed line by line into the configuration, so you could also use:
|
The config will be printed line by line into the configuration, so you could also use:
|
||||||
|
|
||||||
@ -92,6 +94,7 @@ The 2nd parameter `telegraf_plugins_extra` can be used to add plugins specific t
|
|||||||
|
|
||||||
Telegraf plugin options:
|
Telegraf plugin options:
|
||||||
|
|
||||||
|
* `tags` An k/v tags to apply to a specific input's measurements. Can be used on any stage for better filtering for example in outputs.
|
||||||
* `pass`: An array of strings that is used to filter metrics generated by the current plugin. Each string in the array is tested as a prefix against metric names and if it matches, the metric is emitted.
|
* `pass`: An array of strings that is used to filter metrics generated by the current plugin. Each string in the array is tested as a prefix against metric names and if it matches, the metric is emitted.
|
||||||
* `drop`: The inverse of pass, if a metric name matches, it is not emitted.
|
* `drop`: The inverse of pass, if a metric name matches, it is not emitted.
|
||||||
* `tagpass`: (added in Telegraf 0.1.5) tag names and arrays of strings that are used to filter metrics by the current plugin. Each string in the array is tested as an exact match against the tag name, and if it matches the metric is emitted.
|
* `tagpass`: (added in Telegraf 0.1.5) tag names and arrays of strings that are used to filter metrics by the current plugin. Each string in the array is tested as an exact match against the tag name, and if it matches the metric is emitted.
|
||||||
@ -103,6 +106,8 @@ An example might look like this:
|
|||||||
telegraf_plugins_default:
|
telegraf_plugins_default:
|
||||||
- plugin: disk
|
- plugin: disk
|
||||||
interval: 12
|
interval: 12
|
||||||
|
tags:
|
||||||
|
- diskmetrics = "true"
|
||||||
tagpass:
|
tagpass:
|
||||||
- fstype = [ "ext4", "xfs" ]
|
- fstype = [ "ext4", "xfs" ]
|
||||||
- path = [ "/opt", "/home" ]
|
- path = [ "/opt", "/home" ]
|
||||||
|
@ -54,6 +54,11 @@
|
|||||||
{{ items }}
|
{{ items }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if item.tags is defined and item.tags is iterable %}
|
||||||
|
[inputs.{{ item.plugin }}.tags]
|
||||||
|
{% for items in item.tags %}
|
||||||
|
{{ items }}
|
||||||
|
{% endfor %}
|
||||||
{% if item.tagpass is defined and item.tagpass is iterable %}
|
{% if item.tagpass is defined and item.tagpass is iterable %}
|
||||||
[{{ item.plugin }}.tagpass]
|
[{{ item.plugin }}.tagpass]
|
||||||
{% for items in item.tagpass %}
|
{% for items in item.tagpass %}
|
||||||
|
Reference in New Issue
Block a user