-
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
Wildcard support on domains #57
Conversation
Great work, thanks @olivielpeau. I'll review your PR really soon 😃. |
Usage of wildcard is a bit confusing here: I'd expect If we only want to add support for domain and subdomain, then maybe a simple |
Yeah I agree, the wildcard is confusing, the @sjenriquez do you think adding an |
I believe
|
I think it makes more sense to use regexes for both domains and attributes, the whole thing being behind a feature flag. It's way more flexible and will solve the issue one and for all. |
We could allow patterns described in the ObjectName java doc here (basically allowing We would probably need some refactoring to implement these regexes: instead of selecting all the bean names and then filtering them ourselves to match them with the configuration, we could directly query the MBeanServer with our regexes (unless there's a good reason to use the current logic). |
@remh If these patterns make sense to you I'll start implementing. |
I don't think we can query for particular objects in the JMX implementation of java 1.6 (it was i think introduced with Java 1.7), unfortunately java 1.6 is still used a lot and we need to support it. So, we can indeed implement * and ? but we will need to convert this into proper regexes and then use regexes to match the bean names ourselves. Let me know if you have more questions. |
@remh Actually I was thinking about this specific method, and it seems to be part of java 6: http://docs.oracle.com/javase/6/docs/api/javax/management/MBeanServerConnection.html#queryMBeans(javax.management.ObjectName, javax.management.QueryExp) That said we could indeed use proper regexes. |
Nice, however if we have to run 100 queries (to get 100 beans for example) it will likely be slower than iterating once over all the beans and do the matching ourselves. Could you benchmark the two solution with different kind of configurations (most importantly the default ones used by the cassandra,tomcat, kafka and activemq integrations) ? |
👍 for wildcard support. However, I am not sure it meets the initial expectations: querying a domain and its subdomains, would require two 'include' statements i.e - include:
domain: org.foo
...
- include:
domain: org.foo.*
... |
60d80ae
to
1591df5
Compare
@yannmh @remh For instance, a valid configuration would be:
The The drawback is that we can't directly use regexes on specific keys like |
Looks great ! |
Merging then 🏁 |
Wildcard support on domains
@yannmh
Adds support for wildcards at the end of domain names.
For instance:
would match the domains
org.foo
andorg.foo.bar
, but notorg.foobar
.I'll update https://github.com/DataDog/documentation accordingly if you're ok with this behaviour.