[feature/proposal] [jmx_exporter] Connecting via PID to local vm

37 views
Skip to first unread message

Andrzej Ressel

unread,
Sep 13, 2023, 1:23:48 PM9/13/23
to Prometheus Developers
Hi,

Currently jmx_exporter supports java agent and connecting to rmi/jmx server. 

In my case the application is already running with jmx disabled (as in no jmx arguments are set) and since it's in production I cannot restart it to set required arguments.

I've prepared support for connecting to already running application using VirtualMachine::startLocalManagementAgent() and I would like to gather feedback if I should open pull request with that.

Andrzej

Doug Hoard

unread,
Sep 14, 2023, 12:14:29 AM9/14/23
to Prometheus Developers
Interesting. Looking at the VirtualMachine class...

1. There doesn't appear to be a way to remove the agent once attached, How would you handle patching? The JMX exporter uses some singleton classes, so you can't run multiple versions.
2. This functionality doesn't require any changes to the JMX exporter. i.e. you can write a separate tool outside of the JMX exporter.
3. Attaching with incorrect configuration will cause the JMX exporter to signal the VM to exit (System.exit) (While we could remove the System.exit, it still doesn't address 1)
4. In my experience, dynamic attachment support hasn't been a requested feature.

Thoughts?
Reply all
Reply to author
Forward
0 new messages