Open hackery opened 3 years ago
I realise 1.13 is fairly old now, so I've just repeated the test using a 1.18.2 binary download, and with a local build from nearly-current master branch:
$ ./telegraf-1.18.2/usr/bin/telegraf --config etc.testcase.filter/telegraf.conf --test
2021-05-12T17:31:29Z I! Starting Telegraf 1.18.2
> otherWantedMetric value=0 1620840690000000000
$ ../src/influxdata/telegraf/telegraf --version
Telegraf unknown (git: master b56ffdc4)
$ ../src/influxdata/telegraf/telegraf --config etc.testcase.filter/telegraf.conf --test
2021-05-12T17:32:48Z I! Starting Telegraf
> otherWantedMetric value=0 1620840769000000000
Relevant telegraf.conf:
System info:
Telegraf 1.13.3 (git: HEAD da364558)
Steps to reproduce:
Expected behavior:
Metrics are correctly filtered:
Actual behavior:
Some metrics are dropped when they should be passed (or vice versa for "drop" rules):
Additional info:
Removing
otherWantedMetric*
from the filter list, permits the "process32" ones to pass:Depending on the specific wildcards used in a set of patterns, there is sometimes also an ordering dependency, where switching two patterns filters correctly.
I believe this behaviour is due to bugs in the gobwas/glob library (several cases of unexpected pattern behaviour have been reported over its lifetime) and I've created issue gobwas/glob#50 there, but there may also be mitigations or changes to make in Telegraf:
{*process32:*.exe:*.*,otherWantedMetric*}
which seems to be a case where gobwas/glob fails*
,?
,[]
and{}
which existing Telegraf users may depend on (although, if they're not reliable, cough))