Skip to content

Commit

Permalink
Will this break?
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosroman committed May 31, 2024
1 parent fc57775 commit f54ac38
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/org/datadog/jmxfetch/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ public App(final AppConfig appConfig) {
}
this.configs = getConfigs(this.appConfig);

this.initTelemetryBean();
if (this.appConfig.getJmxfetchTelemetry()) {
log.info("Enabling JMX Fetch Telemetry");
this.initTelemetryBean();
}
}

private ObjectName getAppTelemetryBeanName() {
Expand Down Expand Up @@ -176,6 +179,9 @@ private void initTelemetryBean() {
}

private void teardownTelemetry() {
if (!this.appConfig.getJmxfetchTelemetry()){
return;
}
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
ObjectName appTelemetryBeanName = getAppTelemetryBeanName();
if (appTelemetryBeanName == null) {
Expand Down

0 comments on commit f54ac38

Please sign in to comment.