Issue 9336: Auto-instrumentation with JMX not working without a trigger (#9362)
This commit is contained in:
parent
323be549f5
commit
71db9ff7ca
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
package io.opentelemetry.instrumentation.jmx.engine;
|
package io.opentelemetry.instrumentation.jmx.engine;
|
||||||
|
|
||||||
|
import java.lang.management.ManagementFactory;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -38,6 +39,13 @@ class BeanFinder {
|
||||||
void discoverBeans(MetricConfiguration conf) {
|
void discoverBeans(MetricConfiguration conf) {
|
||||||
this.conf = conf;
|
this.conf = conf;
|
||||||
|
|
||||||
|
if (!conf.isEmpty()) {
|
||||||
|
// Issue 9336: Corner case: PlatformMBeanServer will remain unitialized until a direct
|
||||||
|
// reference to it is made. This call makes sure that the PlatformMBeanServer will be in
|
||||||
|
// the set of MBeanServers reported by MBeanServerFactory.
|
||||||
|
ManagementFactory.getPlatformMBeanServer();
|
||||||
|
}
|
||||||
|
|
||||||
exec.schedule(
|
exec.schedule(
|
||||||
new Runnable() {
|
new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue