Apply filters on prometheus 'up' metrics#16568
Conversation
Signed-off-by: chrismark <chrismarkou92@gmail.com>
Signed-off-by: chrismark <chrismarkou92@gmail.com>
Signed-off-by: chrismark <chrismarkou92@gmail.com>
| // This would mean that we want to keep only the metrics that start with node_ prefix but | ||
| // are not related to disk so we exclude node_disk_* metrics from them. | ||
|
|
||
| if family == nil { |
There was a problem hiding this comment.
Ok, I see what you did here.
I'm not sure if it isn't safer to keep the family == nil check here, but split the whole method body into two methods: skipFamily and skipFamilyName. WDYT? It might prevent next developers from making mistakes (nil structure).
mtojek
left a comment
There was a problem hiding this comment.
If it's doesn't blow up any system tests, please consider these changes approved. Thanks!
(cherry picked from commit ae34415)
|
We cannot make the regexp matching work. So if we want to exclude all metrics ending in e.g. This PR also did not add any tests wrt. regexp matching. |
Hi! Tests had been added on the PR(#16420) that originally added this functionality (https://github.com/elastic/beats/pull/16420/files#diff-5945e5b443352401ece4bbac9bbb653cR205). For such questions please refer to https://discuss.elastic.co/tags/c/elastic-stack/81/metricbeat. |
|
There are no regexp tests, I added some myself and they do work correctly locally on the master build. But it does fail to process/match regex excludes using metricbeat 7.9.1 on CentOS (installed using the RPM). Even the example regex ( I will propose a PR adding those regex matching examples to the tests. |
Closes #16564