tag filtering description added

This commit is contained in:
Simon Fraser 2015-08-10 20:42:59 +01:00 committed by Cameron Sparr
parent 3ecb5a20a5
commit c1dc77c69c
1 changed files with 27 additions and 2 deletions

View File

@ -79,13 +79,38 @@ want to add support for another service or third-party API.
There are 3 configuration options that are configurable per plugin:
* **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 metrics
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 matches, it is not emitted.
* **drop**: The inverse of pass, if a metric name matches, it is not emitted.
* **tagpass**: 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.
* **tagdrop**: The inverse of tagpass. If a tag matches, the metric is not emitted.
This is tested on metrics that have passed the tagpass test.
* **interval**: How often to gather this metric. Normal plugins use a single
global interval, but if one particular plugin should be run less or more often,
you can configure that here.
### Plugin Configuration Example
```
# Read metrics about disk usage by mount point
[disk]
interval = "1m" # Run at a 1 minute interval instead of the default
[disk.tagpass]
# These tag conditions are OR, not AND.
# If the (filesystem is ext4 or xfs) or (the path is /opt or /home) then the metric passes
fstype = [ "ext4", "xfs" ]
path = [ "/", /opt", "/home" ]
# Any metrics that succeed at 'tagpass' are then checked to see if they should be dropped
[disk.tagdrop]
# Drop the root mountpoint from the metrics
path = [ "/" ]
```
## Plugins
This section is for developers that want to create new collection plugins.