Skip to content

Commit

Permalink
tagpass/drop
Browse files Browse the repository at this point in the history
  • Loading branch information
jrha committed Aug 22, 2023
1 parent 910347b commit 4c01f63
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
28 changes: 12 additions & 16 deletions ncm-metaconfig/src/main/metaconfig/telegraf/pan/schema.pan
Expand Up @@ -139,22 +139,6 @@ type telegraf_plugin_common = {
}
'namedrop' ? string_trimmed[]

# NOTE: Due to the way TOML is parsed,
# tagpass and tagdrop parameters must be defined at the end of the plugin definition,
# otherwise subsequent plugin config options will be interpreted as part of the tagpass/tagdrop tables.

# @{
# A table mapping tag keys to arrays of glob pattern strings.
# Only metrics that contain a tag key in the table and a tag value matching one of its patterns is emitted.
# }
# 'tagpass' ? string_trimmed{}

# @{
# The inverse of tagpass. If a match is found the metric is discarded.
# This is tested on metrics after they have passed the tagpass test.
# }
# 'tagdrop' ? string_trimmed{}

@{
An array of glob pattern strings.
Only fields whose field key matches a pattern in this list are emitted.
Expand All @@ -180,6 +164,18 @@ type telegraf_plugin_common = {
Any tag can be filtered including global tags and the agent host tag.
}
'tagexclude' ? string_trimmed[]

# @{
# A table mapping tag keys to arrays of glob pattern strings.
# Only metrics that contain a tag key in the table and a tag value matching one of its patterns is emitted.
# }
'tagpass' ? string_trimmed{}

# @{
# The inverse of tagpass. If a match is found the metric is discarded.
# This is tested on metrics after they have passed the tagpass test.
# }
'tagdrop' ? string_trimmed{}
};

# Common to Input, Aggregator and Output plugins
Expand Down
Expand Up @@ -41,6 +41,16 @@ prefix "/software/components/metaconfig/services/{/etc/telegraf.ini}/contents";
'tmpfs',
'devtmpfs',
),
'tagpass', dict(
'fstype', list(
"ext4",
"xfs",
),
'path', list(
"/opt",
"/home*",
),
),
),
);

Expand Down
Expand Up @@ -42,3 +42,6 @@ Base test for config
[[inputs.disk]]
mount_points = ["/", "/pool"]
ignore_fs = ["tmpfs", "devtmpfs"]
[inputs.disk.tagpass]
fstype = [ "ext4", "xfs" ]
path = [ "/opt", "/home*" ]

0 comments on commit 4c01f63

Please sign in to comment.