-
Notifications
You must be signed in to change notification settings - Fork 70
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
Adds support for bean regex tagging #167
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a single nit, but I think this looks like a pretty clean change.
|
||
if(m.matches()) { | ||
for (int i = 0; i<= m.groupCount(); i++) { | ||
this.beanParameters.put(""+i, m.group(i)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a stylistic issue, not a technical one. I don't love
""+i
I don't think it's very clear. I think it would be better to make it more clear:
Integer.toString(i)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, that is definitely cleaner. Thanks!
Adds support for using the bean_regex syntax to capture groups for tags.
We currently support pulling in common attributes out of bean names, but this introduces the ability to specify any custom substring of a bean name to utilize as a tag on the associated attributes.
Ex:
This will submit the metric
tomcat.spareNotFound
with tagshostRegex:<beanParameter>
,TypeRegex:<beanParameter>
, andcontextRegex<beanParameter>
as well as the tag with keyoptional
and valuetag