Skip to content

Commit fdeb9fe

Browse files
committed
GH-862: expose all actuators via JMX for live hovers automatically when launching
1 parent cb78131 commit fdeb9fe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: vscode-extensions/vscode-spring-boot/lib/debug-config-provider.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import psList from 'ps-list';
66
import { ListenablePreferenceSetting } from "@pivotal-tools/commons-vscode/lib/launch-util";
77

88
const JMX_VM_ARG = '-Dspring.jmx.enabled='
9+
const ACTUATOR_JMX_EXPOSURE_ARG = '-Dmanagement.endpoints.jmx.exposure.include='
910
const ADMIN_VM_ARG = '-Dspring.application.admin.enabled='
1011
const BOOT_PROJECT_ARG = '-Dspring.boot.project.name=';
1112
const RMI_HOSTNAME = '-Djava.rmi.server.hostname=localhost';
@@ -23,6 +24,9 @@ class SpringBootDebugConfigProvider implements DebugConfigurationProvider {
2324
if (debugConfiguration.vmArgs.indexOf(JMX_VM_ARG) < 0) {
2425
debugConfiguration.vmArgs += ` ${JMX_VM_ARG}true`;
2526
}
27+
if (debugConfiguration.vmArgs.indexOf(ACTUATOR_JMX_EXPOSURE_ARG) < 0) {
28+
debugConfiguration.vmArgs += ` ${ACTUATOR_JMX_EXPOSURE_ARG}*`;
29+
}
2630
if (debugConfiguration.vmArgs.indexOf(ADMIN_VM_ARG) < 0) {
2731
debugConfiguration.vmArgs += ` ${ADMIN_VM_ARG}true`;
2832
}
@@ -33,7 +37,7 @@ class SpringBootDebugConfigProvider implements DebugConfigurationProvider {
3337
debugConfiguration.vmArgs += ` ${RMI_HOSTNAME}`;
3438
}
3539
} else {
36-
debugConfiguration.vmArgs = `${JMX_VM_ARG}true ${ADMIN_VM_ARG}true ${BOOT_PROJECT_ARG}${debugConfiguration.projectName} ${RMI_HOSTNAME}`;
40+
debugConfiguration.vmArgs = `${JMX_VM_ARG}true ${ACTUATOR_JMX_EXPOSURE_ARG}* ${ADMIN_VM_ARG}true ${BOOT_PROJECT_ARG}${debugConfiguration.projectName} ${RMI_HOSTNAME}`;
3741
}
3842
}
3943
return debugConfiguration;

0 commit comments

Comments
 (0)