From c1dc77c69cbc1bfafa19f613854ae01421464ed8 Mon Sep 17 00:00:00 2001 From: Simon Fraser Date: Mon, 10 Aug 2015 20:42:59 +0100 Subject: [PATCH] tag filtering description added --- README.md | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a13530fca..e0d802a8d 100644 --- a/README.md +++ b/README.md @@ -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.