GH-862: expose all actuators via JMX for live hovers automatically when launching

This commit is contained in:
Martin Lippert
2022-11-07 12:19:08 +01:00
parent cb7813109e
commit fdeb9fe730

View File

@@ -6,6 +6,7 @@ import psList from 'ps-list';
import { ListenablePreferenceSetting } from "@pivotal-tools/commons-vscode/lib/launch-util";
const JMX_VM_ARG = '-Dspring.jmx.enabled='
const ACTUATOR_JMX_EXPOSURE_ARG = '-Dmanagement.endpoints.jmx.exposure.include='
const ADMIN_VM_ARG = '-Dspring.application.admin.enabled='
const BOOT_PROJECT_ARG = '-Dspring.boot.project.name=';
const RMI_HOSTNAME = '-Djava.rmi.server.hostname=localhost';
@@ -23,6 +24,9 @@ class SpringBootDebugConfigProvider implements DebugConfigurationProvider {
if (debugConfiguration.vmArgs.indexOf(JMX_VM_ARG) < 0) {
debugConfiguration.vmArgs += ` ${JMX_VM_ARG}true`;
}
if (debugConfiguration.vmArgs.indexOf(ACTUATOR_JMX_EXPOSURE_ARG) < 0) {
debugConfiguration.vmArgs += ` ${ACTUATOR_JMX_EXPOSURE_ARG}*`;
}
if (debugConfiguration.vmArgs.indexOf(ADMIN_VM_ARG) < 0) {
debugConfiguration.vmArgs += ` ${ADMIN_VM_ARG}true`;
}
@@ -33,7 +37,7 @@ class SpringBootDebugConfigProvider implements DebugConfigurationProvider {
debugConfiguration.vmArgs += ` ${RMI_HOSTNAME}`;
}
} else {
debugConfiguration.vmArgs = `${JMX_VM_ARG}true ${ADMIN_VM_ARG}true ${BOOT_PROJECT_ARG}${debugConfiguration.projectName} ${RMI_HOSTNAME}`;
debugConfiguration.vmArgs = `${JMX_VM_ARG}true ${ACTUATOR_JMX_EXPOSURE_ARG}* ${ADMIN_VM_ARG}true ${BOOT_PROJECT_ARG}${debugConfiguration.projectName} ${RMI_HOSTNAME}`;
}
}
return debugConfiguration;