- 2 minutes to read

JMX, FAQ, Troubleshooting, Common Questions JMX, FAQ, troubleshooting, common questions 5. Can I monitor JVMs running in Docker containers or Kubernetes?

5. Can I monitor JVMs running in Docker containers or Kubernetes?

5. Can I monitor JVMs running in Docker containers or Kubernetes?

YES - via exposed JMX ports:

Approach 1: Docker port mapping

  • Run Java container with JMX enabled: docker run -p 5002:5002 -e JAVA_OPTS="-Dcom.sun.management.jmxremote.port=5002 ..." myapp:latest
  • Map container JMX port to host port (-p 5002:5002)
  • Gateway connects to Docker host IP:5002, monitoring works transparently

Approach 2: Kubernetes Service

  • Create Kubernetes Service exposing JMX port: type: NodePort or type: LoadBalancer, port: 5002
  • Gateway connects to Service IP:5002 (routes to pod), survives pod restarts (Service IP stable)
  • For multiple pods (replicas), create separate Service per pod OR use StatefulSet with predictable pod names

Approach 3: Gateway in same Kubernetes cluster

  • Deploy JMX API Gateway as Kubernetes Deployment in same namespace as monitored pods
  • Gateway connects to pod IPs directly (internal cluster networking), no port mapping required
  • Use Kubernetes DNS for pod discovery: myapp-0.myapp-svc.default.svc.cluster.local:5002

Approach 4: Prometheus JMX Exporter (alternative)

  • Instead of JMX Gateway, use Prometheus JMX Exporter sidecar in pod
  • Export JMX metrics to Prometheus format, scrape with Prometheus, visualize in Grafana
  • Trade-off: More complex setup, requires Prometheus infrastructure, less integrated with Nodinite

Boomi Atom in Docker: Boomi provides official Docker images (boomi/atom), configure JMX port via environment variable JMX_PORT=5002, expose port in docker run command.


See all FAQs: [Troubleshooting Overview][]