oracle / oracle/visualvm

[Feature] JMX Proxy - Attach to running JVM and make available remotely

Open
#42 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
3.3k
Forks
334
PR merge metrics
No merged PRs in 30d

Description

Feature Requests - JMX Proxy

I came across the blog post here that shows how to use jstatd to basically proxy connections to a running JVM from a remote VisualVM instance. How cool. But it is limited and I wish there was a way to do this w/ JMX. Sure, I could stop the JVM and add the jmxremote* JVM properties, but then I'd have to stop a Tomcat instance in this case.

I am not a Java Developer or I would take it on myself, but I presume the maintainers of VisualVM are java developers. Furthermore, a JMX proxy might be something other VisualVM users are interested in. Is this a feature/tool you would consider taking on?

Obligatory ASCII Art

  +----Host----+               +--Workstation-+
  ||Target JVM||               |              |
  ||          ||               |              |
  ||     ^    ||               |              |
  |------------|               |              |
  ||Proxy|JVM--|               +-VisualVM/ETC-+
  ||     +    ||               ||            ||
  ||         ^--------TCP--------+           ||
  |------------|               |--------------|
  +------------+               +--------------+

Example Usage

  1. Connect to remote machine
  2. Run java -jar com.foo.jmx-proxy.jar -Djmx-proxy.localpid=1234 -Djmx-proxy.port=9999 -Djmx-proxy.address=localhost
  3. SSH and tunnel 9999 to target box
  4. Start Visual VM on workstation, connect to localhost:9999
  5. Profit!

Thoughts

  • Similar settings to com.sun.management.jmxremote.*
    • Auth, ssl, port, server etc
  • Maybe socks proxy support? ssh -D
  • Instead of specifying PID could it be selectable like w/ jstatd+VisualVM

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository files, tests, or entry points are named. Start by reviewing VisualVM's existing remote connection flow and the Java JMX remote settings described in the issue; done would require a defined proxy design, including attachment to a running JVM, remote access, authentication, SSL, and port configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools, observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.