-
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
[tags] service instance tag should not be excluded if specified. #360
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.
Taking a step back, I think there are 2 ways to solve this use case:
- make the
exclude_tags
list apply only to the tags that are inferred from the bean parameters, and not to the tags that come from the instance-level orinclude
-leveltags
config key. I can't think of a use case where excluding atags
-configured tag withexclude_tags
is useful, since these tags don't add cardinality to the collected metrics (unless users want to remove thejmx_instance
tag for example so that the Agent's dogstatsd server does aggregation across JMXFetch instances, but I don't know if this is a realistic use case).
However, the current implementation and tests makeexclude_tags
explicitly exclude instance/include
-level configured tags as well, so trying to change this now would require carefully considering all possible use cases. Or introducing a new config option such asexclude_bean_tags
. - we can decide to limit this change to only the
service
config key, which is close to what you implemented so far in this PR. In this case, for consistency, I thinkexclude_tags
values should still apply to aservice:
tag defined under thetags
config key. Then, to keep the implementation simpler, instead of keeping a reference to the wholeinstanceTags
inJMXAttribute
and then matching theservice
tag explicitly, I think it'd be better to make theInstance
pass theservice
value as a separate variable toJMXAttribute
(and not pass it in theinstanceTags
map), and then simply makeJMXAttribute
add thisservice
value as theservice:
tag after theexclude_tags
logic.
Overall, I think option 2.
is better for now (with the changes I suggested), WDYT?
A new config option named exclude_bean_tags
could make sense in the future, to implement option 1.
@olivielpeau I'm not entirely sure why doing (2) changing the api to pass a string for the |
I think (2) has 2 benefits over the current implementation:
The rest of the logic in this class is complex enough (this is legacy code for sure), so I'm trying to avoid adding any unnecessary complexity. |
If you feel strongly about it, I'll make the change, but I need to change 4 interfaces to the various |
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.
A couple more comments, let me know
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.
LGTM, thanks!
This PR aims to allow the exclusion of the
service
jmx attribute that would otherwise be assigned as a tag while keeping the tag for theservice
as specified on the JMXFetch config. For instance, with this example configuration: