Skip to content

Apply filters on prometheus 'up' metrics#16568

Merged
ChrsMark merged 5 commits intoelastic:masterfrom
ChrsMark:prom_up_metrics
Feb 26, 2020
Merged

Apply filters on prometheus 'up' metrics#16568
ChrsMark merged 5 commits intoelastic:masterfrom
ChrsMark:prom_up_metrics

Conversation

@ChrsMark
Copy link
Copy Markdown
Member

Closes #16564

Signed-off-by: chrismark <chrismarkou92@gmail.com>
Signed-off-by: chrismark <chrismarkou92@gmail.com>
Signed-off-by: chrismark <chrismarkou92@gmail.com>
@ChrsMark ChrsMark added enhancement Team:Integrations Label for the Integrations team Team:Platforms Label for the Integrations - Platforms team labels Feb 25, 2020
@ChrsMark ChrsMark requested a review from a team February 25, 2020 16:19
@ChrsMark ChrsMark self-assigned this Feb 25, 2020
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 {
Copy link
Copy Markdown
Contributor

@mtojek mtojek Feb 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Signed-off-by: chrismark <chrismarkou92@gmail.com>
Copy link
Copy Markdown
Contributor

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's doesn't blow up any system tests, please consider these changes approved. Thanks!

@ChrsMark ChrsMark added needs_backport PR is waiting to be backported to other branches. v7.7.0 labels Feb 26, 2020
@ChrsMark ChrsMark merged commit ae34415 into elastic:master Feb 26, 2020
ChrsMark added a commit to ChrsMark/beats that referenced this pull request Feb 26, 2020
@ChrsMark ChrsMark removed the needs_backport PR is waiting to be backported to other branches. label Feb 26, 2020
ChrsMark added a commit that referenced this pull request Feb 26, 2020
@dagwieers
Copy link
Copy Markdown

We cannot make the regexp matching work. So if we want to exclude all metrics ending in e.g. _sum or _max it currently does not seem possible.

This PR also did not add any tests wrt. regexp matching.

@ChrsMark
Copy link
Copy Markdown
Member Author

We cannot make the regexp matching work. So if we want to exclude all metrics ending in e.g. _sum or _max it currently does not seem possible.

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).
In addition this feature is also used by other modules under the hood like redisenterprise

and is there are no issues reported so far.

For such questions please refer to https://discuss.elastic.co/tags/c/elastic-stack/81/metricbeat.

@dagwieers
Copy link
Copy Markdown

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 (^async_dgcjobs_seconds_sum$) fails to exclude it on our system. No regex matching works (not even .*_sum$).

I will propose a PR adding those regex matching examples to the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement review Team:Integrations Label for the Integrations team Team:Platforms Label for the Integrations - Platforms team v7.7.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skip “up” metrics too when not in Prometheus filters

4 participants