-
Notifications
You must be signed in to change notification settings - Fork 858
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
Allow JMX Insight reuse for remote connections #12178
Conversation
@robsunday this will be required in order to be able to use remote JMX connections. |
I've marked the PR as "ready for review" as it's working with the provided code example, so it should be quite straightforward to extend this to support other remote connection variants with certificates and authentication. |
@PeterF778 your input might be welcome on this JMX related PR too. |
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.
Looks good. Thanks for doing this.
When trying to reuse JMX Insight implementation in contrib (open-telemetry/opentelemetry-java-contrib#1445), the current implementation assumes that only local instances of
MBeanServer
are used, so we need to enable reusing it for remote connections.Fortunately as
MBeanServer
(1) extendsMBeanServerConnection
(2), this mostly requires to replace (1) with (2).PR initially opened as draft and does not need review for now until we have validated it works as we expect for remote connections with related PR.
For example, for a JVM configured with JMX to listen on
localhost:9999
with the following JVM arguments:The following example code allows to capture metrics from this JVM (at least for metric registration, proper end-to-end testing will be required on consumer side).