Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to exclude/filter attributes #110

Open
dhay opened this issue Sep 15, 2017 · 2 comments
Open

Ability to exclude/filter attributes #110

dhay opened this issue Sep 15, 2017 · 2 comments

Comments

@dhay
Copy link

dhay commented Sep 15, 2017

In our applications, we use the Codahale/Dropwizard metrics library to publish our metrics to JMX. Rather than configure each metric, I'd like to grab everything under a particular domain. For example, something like this:

<query objectName="MyApplication-metrics:type=*,group=*,name=*"
       resultAlias="app.%type%.%group%.%name%.#attribute#"/>

However, because of the way the metrics are published to JMX, I end up with metrics that aren't really metrics. For example:

myapplication.app.API.ALL_statusSeries_5xx.responseTime.RateUnit events/second 1505500740
myapplication.app.API.ALL_statusSeries_5xx.responseTime.DurationUnit milliseconds 1505500740

What I'd really like to do is specify a set of attributes not to include. The configuration might look something like this:

<query objectName="MyApplication-metrics:type=*,group=*,name=*"
       excludeAttributes="RateUnit,DurationUnit"
       resultAlias="app.%type%.%group%.%name%.#attribute#"/>

I'm guessing that some might want to do something similar when processing CompositeData, though I don't personally have that need at the moment.

Thanks!

@dhay
Copy link
Author

dhay commented Jul 27, 2018

Another way to solve this would be to overload the attribute and attributes field such that any attributes preceded by a minus sign (-) would be excluded. I've started a branch using this approach for a future pull request.

For example

<query objectName="MyApplication-metrics:type=*,group=*,name=*"
       attributes="-RateUnit,-DurationUnit"
       resultAlias="app.%type%.%group%.%name%.#attribute#"/>

@cyrille-leclerc
Copy link
Member

smart idea @dhay !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants