Enabling remote JMX agent on the Traffic Manager pod (applicable for 6.x.x)
Use this procedure to expose the standard JMX remote protocol on the Traffic Manager pod, so you can connect with JConsole, VisualVM, or jmxterm instead of curling the /jmx servlet from inside the pod.
Before you begin
The steps below assume the Traffic Manager image already ships a full JVM with the built-in JMX management agent. If your image is a minimal or stripped-down JRE that doesn't include it, you must add a JMX agent to the image and modify the Java startup parameters to load it. Adding the jmxremote JVM arguments alone won't enable remote JMX without the agent present.
Steps
Procedure
-
Open the trafficmanager chart's
values.yamlfile, located atdeploy/charts/trafficmanager/values.yaml. -
In values.yaml, locate the
runtime.argsblock:runtime:
args:
- "-Xms2048m"
- "-Xmx2048m" -
Add the following entries to the
runtime.argslist.- Replace
<jmx-port>with any free port (9010is a common default). Use the same port for bothjmxremote.portandjmxremote.rmi.port. - Set
authenticate=falseandssl=falsefor local or development clusters only. Do not use these settings in shared or production environments.
- "-Dcom.sun.management.jmxremote=true"
- "-Dcom.sun.management.jmxremote.port=<jmx-port>"
- "-Dcom.sun.management.jmxremote.rmi.port=<jmx-port>"
- "-Dcom.sun.management.jmxremote.authenticate=false"
- "-Dcom.sun.management.jmxremote.ssl=false"
- "-Djava.rmi.server.hostname=127.0.0.1" - Replace
-
Run
helm upgrade(or re-apply the chart) so the Traffic Manager pod restarts with the updated args. -
Connect to the pod:
kubectl port-forward pod/<trafficmanager-pod> <jmx-port>:<jmx-port>Then point JConsole, VisualVM, or jmxterm at
localhost:<jmx-port>.noteNo change to
trafficmanager-svc.yamlis needed.kubectl port-forwardworks regardless of the declaredcontainerPorts.Here
<jmx-port>should match the port you set inruntime.args(9010by default, or whatever free port you chose).
Traffic Manager output
Connection pool MBean (com.mashery.proxy.management:type=ConnectionPool,name=JettyConnectionPool)
Returns connectionData, one entry per configured connector, with connection counts, byte and message counters, connection-duration statistics, port, protocol, state, and keystore. Alongside it, the thread-pool attributes threadPoolThreads, threadPoolIdleThreads, threadPoolMinThreads, and threadPoolMaxThreads.
{
"error": null,
"results": [
{
"values": {
"connectionData": [
{
"values": {
"Connections": 0,
"ReceivedBytes": 0,
"ReceivedMessages": 0,
"SentBytesRate": 0,
"ConnectionsMax": 0,
"ConnectionsTotal": 0,
"Port": 5080,
"ConnectionDurationMax": 0,
"ConnectionDurationStdDev": 0,
"Name": null,
"Keystore": " ",
"SentMessagesRate": 0,
"SentBytes": 0,
"State": "STARTED",
"SentMessages": 0,
"ConnectionDurationMean": 0,
"Protocol": "HTTP/1.1",
"ReceivedMessagesRate": 0,
"ReceivedBytesRate": 0
}
}
],
"threadPoolIdleThreads": 1,
"threadPoolMaxThreads": 32,
"threadPoolMinThreads": 4,
"threadPoolThreads": 4
}
}
]
}
Memory MBean (java.lang:type=Memory)
Returns heap and non-heap memory usage (init, committed, max, used) and the count of objects pending finalization.
{
"error": null,
"results": [
{
"values": {
"ObjectPendingFinalizationCount": 0,
"HeapMemoryUsage": {
"values": {
"init": 603979776,
"committed": 218103808,
"max": 9663676416,
"used": 87691576
}
},
"NonHeapMemoryUsage": {
"values": {
"init": 7667712,
"committed": 115277824,
"max": -1,
"used": 112903568
}
},
"Verbose": false,
"ObjectName": {
"domainPattern": false,
"propertyListPattern": false,
"propertyValuePattern": false,
"keyPropertyListString": "type=Memory",
"pattern": false,
"propertyPattern": false,
"canonicalKeyPropertyListString": "type=Memory",
"domain": "java.lang",
"canonicalName": "java.lang:type=Memory",
"keyPropertyList": {
"type": "Memory"
}
}
}
}
]
}
Runtime MBean (java.lang:type=Runtime)
Returns JVM startup and environment data, such as VM version and uptime. Fields that vary by deployment (ClassPath, InputArguments, LibraryPath, BootClassPath) are omitted here since they contain deployment-specific values (such as local file paths and hostnames) that don't represent a typical or expected output. SystemProperties is shown with a couple of properties as an example, each now includes its actual value alongside the deprecated compositeType.
As of Local Edition 6.3.0, each property in SystemProperties also includes its actual value in addition to the existing compositeType metadata.
{
"error": null,
"results": [
{
"values": {
"ManagementSpecVersion": "4.0",
"SpecName": "Java Virtual Machine Specification",
"SpecVendor": "Oracle Corporation",
"SpecVersion": "21",
"Pid": 96405,
"BootClassPathSupported": false,
"VmName": "Java HotSpot(TM) 64-Bit Server VM",
"VmVendor": "Oracle Corporation",
"VmVersion": "21.0.6+8-LTS-188",
"LibraryPath": "<omitted, environment-specific>",
"BootClassPath": "<omitted, environment-specific>",
"Uptime": 196838,
"Name": "<pid>@<hostname>",
"ClassPath": "<omitted, environment-specific>",
"SystemProperties": "<omitted, environment-specific>",
"InputArguments": "<omitted, environment-specific>",
"StartTime": 1786686584135,
"ObjectName": {
"domainPattern": false,
"propertyListPattern": false,
"propertyValuePattern": false,
"keyPropertyListString": "type=Runtime",
"pattern": false,
"propertyPattern": false,
"canonicalKeyPropertyListString": "type=Runtime",
"domain": "java.lang",
"canonicalName": "java.lang:type=Runtime",
"keyPropertyList": {
"type": "Runtime"
}
}
}
}
]
}
Loader output
Runtime MBean (java.lang:type=Runtime)
Same MBean as the Traffic Manager, exposed on the Loader JVM. Returns the same set of runtime and system-property data.
{
"error": null,
"results": [
{
"values": {
"BootClassPathSupported": false,
"VmName": "Java HotSpot(TM) 64-Bit Server VM",
"VmVendor": "Oracle Corporation",
"VmVersion": "21.0.6+8-LTS-188",
"LibraryPath": "<omitted, environment-specific>",
"BootClassPath": "<omitted, environment-specific>",
"Uptime": 32681,
"ManagementSpecVersion": "4.0",
"SpecName": "Java Virtual Machine Specification",
"SpecVendor": "Oracle Corporation",
"SpecVersion": "21",
"InputArguments": "<omitted, environment-specific>",
"StartTime": 1786355735938,
"SystemProperties": "<omitted, environment-specific>",
"Pid": 1,
"Name": "<pid>@<hostname>",
"ClassPath": "<omitted, environment-specific>",
"ObjectName": {
"domainPattern": false,
"propertyListPattern": false,
"propertyValuePattern": false,
"keyPropertyList": {
"type": "Runtime"
},
"keyPropertyListString": "type=Runtime",
"pattern": false,
"domain": "java.lang",
"propertyPattern": false,
"canonicalKeyPropertyListString": "type=Runtime",
"canonicalName": "java.lang:type=Runtime"
}
}
}
]
}
Connection pool MBean
{
"error": null,
"results": [
{
"values": {
"connectionData": [
{
"values": {
"Connections": 0,
"ReceivedBytes": 0,
"ReceivedMessages": 0,
"SentBytesRate": 0,
"ConnectionsMax": 0,
"ConnectionsTotal": 0,
"Port": 5080,
"ConnectionDurationMax": 0,
"ConnectionDurationStdDev": 0,
"Name": null,
"Keystore": " ",
"SentMessagesRate": 0,
"SentBytes": 0,
"State": "STARTED",
"SentMessages": 0,
"ConnectionDurationMean": 0,
"Protocol": "HTTP/1.1",
"ReceivedMessagesRate": 0,
"ReceivedBytesRate": 0
}
}
],
"threadPoolIdleThreads": 1,
"threadPoolMaxThreads": 32,
"threadPoolMinThreads": 4,
"threadPoolThreads": 4
}
}
]
}
Platform API output
The platformapi container exposes health and performance metrics using Spring Boot's built-in Actuator framework, unlike the JMX-to-HTTP servlet used by Traffic Manager and Loader. Metrics are queried through REST endpoints instead of MBean object names.
Base URL: http://localhost:7000
Listing available metrics
Query the base metrics endpoint to get the full list of metric names available on this container.
Base URL: http://localhost:7000/actuator/metrics
{
"names": [
"application.ready.time",
"application.started.time",
"disk.free",
"disk.total",
"hikaricp.connections",
"hikaricp.connections.acquire",
"hikaricp.connections.active",
"hikaricp.connections.creation",
"hikaricp.connections.idle",
"hikaricp.connections.max",
"hikaricp.connections.min",
"hikaricp.connections.pending",
"hikaricp.connections.timeout",
"hikaricp.connections.usage",
"http.server.requests",
"http.server.requests.active",
"jdbc.connections.active",
"jdbc.connections.idle",
"jdbc.connections.max",
"jdbc.connections.min",
"jetty.connections.bytes.in",
"jetty.connections.bytes.out",
"jetty.connections.current",
"jetty.connections.max",
"jetty.connections.messages.in",
"jetty.connections.messages.out",
"jetty.connections.request",
"jetty.threads.current",
"jetty.threads.idle",
"jvm.buffer.count",
"jvm.buffer.memory.used",
"jvm.buffer.total.capacity",
"jvm.classes.loaded",
"jvm.classes.loaded.count",
"jvm.classes.unloaded",
"jvm.compilation.time",
"jvm.gc.live.data.size",
"jvm.gc.max.data.size",
"jvm.gc.memory.allocated",
"jvm.gc.memory.promoted",
"jvm.gc.overhead",
"jvm.gc.pause",
"jvm.info",
"jvm.memory.committed",
"jvm.memory.max",
"jvm.memory.usage.after.gc",
"jvm.memory.used",
"jvm.threads.daemon",
"jvm.threads.live",
"jvm.threads.peak",
"jvm.threads.platform",
"jvm.threads.started",
"jvm.threads.states",
"jvm.threads.total",
"logback.events",
"process.cpu.time",
"process.cpu.usage",
"process.files.max",
"process.files.open",
"process.start.time",
"process.uptime",
"spring.security.authorizations",
"spring.security.authorizations.active",
"spring.security.filterchains",
"spring.security.filterchains.MasheryAuthenticationFilter.after",
"spring.security.filterchains.MasheryAuthenticationFilter.before",
"spring.security.filterchains.access.exceptions.after",
"spring.security.filterchains.access.exceptions.before",
"spring.security.filterchains.active",
"spring.security.filterchains.authentication.anonymous.after",
"spring.security.filterchains.authentication.anonymous.before",
"spring.security.filterchains.authorization.after",
"spring.security.filterchains.authorization.before",
"spring.security.filterchains.context.async.after",
"spring.security.filterchains.context.async.before",
"spring.security.filterchains.context.holder.after",
"spring.security.filterchains.context.holder.before",
"spring.security.filterchains.context.servlet.after",
"spring.security.filterchains.context.servlet.before",
"spring.security.filterchains.header.after",
"spring.security.filterchains.header.before",
"spring.security.filterchains.logout.after",
"spring.security.filterchains.logout.before",
"spring.security.filterchains.requestcache.after",
"spring.security.filterchains.requestcache.before",
"spring.security.filterchains.session.management.after",
"spring.security.filterchains.session.management.before",
"spring.security.filterchains.session.urlencoding.after",
"spring.security.filterchains.session.urlencoding.before",
"spring.security.http.secured.requests",
"spring.security.http.secured.requests.active",
"system.cpu.count",
"system.cpu.usage",
"system.load.average.1m"
]
}
Querying an individual metric
Append the metric name to the endpoint to get its current value and any breakdown tags it supports.
Memory used
Base URL: http://localhost:7000
curl -s "$BASE_URL/actuator/metrics/jvm.memory.used" | jq '.'
{
"name": "jvm.memory.used",
"description": "The amount of used memory",
"baseUnit": "bytes",
"measurements": [
{
"statistic": "VALUE",
"value": 493960328
}
],
"availableTags": [
{
"tag": "area",
"values": ["heap", "nonheap"]
},
{
"tag": "id",
"values": [
"CodeHeap 'profiled nmethods'",
"G1 Old Gen",
"CodeHeap 'non-profiled nmethods'",
"G1 Survivor Space",
"Compressed Class Space",
"Metaspace",
"G1 Eden Space",
"CodeHeap 'non-nmethods'"
]
}
]
}
Live Threads
curl -s "$BASE_URL/actuator/metrics/jvm.threads.live" | jq '.'
{
"name": "jvm.threads.live",
"description": "The current number of live threads including both daemon and non-daemon threads",
"baseUnit": "threads",
"measurements": [
{
"statistic": "VALUE",
"value": 46.0
}
],
"availableTags": []
}
GC Pause Time
curl -s "$BASE_URL/actuator/metrics/jvm.gc.pause" | jq '.'
{
"name": "jvm.gc.pause",
"description": "Time spent in GC pause",
"baseUnit": "seconds",
"measurements": [
{
"statistic": "COUNT",
"value": 2.0
},
{
"statistic": "TOTAL_TIME",
"value": 0.353
},
{
"statistic": "MAX",
"value": 0.0
}
],
"availableTags": [
{
"tag": "cause",
"values": [
"G1 Evacuation Pause"
]
},
{
"tag": "action",
"values": [
"end of minor GC"
]
},
{
"tag": "gc",
"values": [
"G1 Young Generation"
]
}
]
}
HTTP Request Metrics
curl -s "$BASE_URL/actuator/metrics/http.server.requests" | jq '.measurements'
[
{
"statistic": "COUNT",
"value": 4210.0
},
{
"statistic": "TOTAL_TIME",
"value": 50.929097590000005
},
{
"statistic": "MAX",
"value": 0.0245665
}
]