Skip to content

Commit

Permalink
Reverts unrelated changes to telemetry bean exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
scottopell committed Oct 19, 2023
1 parent c89a9ac commit 7aaf2cb
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/main/java/org/datadog/jmxfetch/Instance.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,17 +257,13 @@ private InstanceTelemetry createJmxBean() {
try {
instanceTelemetryBeanName = getObjName(appConfig.getJmxfetchTelemetryDomain(),
this.getName());
} catch (MalformedObjectNameException e) {
log.warn("Could not construct bean name for jmxfetch_telemetry_domain '{}' and name '{}'", appConfig.getJmxfetchTelemetryDomain(), this.getName());
return bean;
}

try {
mbs.registerMBean(bean,instanceTelemetryBeanName);
log.debug("Succesfully registered jmx bean for instance: " + this.getCheckName()
+ " with ObjectName = " + instanceTelemetryBeanName);
} catch (InstanceAlreadyExistsException | MBeanRegistrationException | NotCompliantMBeanException e) {
log.warn("Could not register bean named '{}' for instance: ", instanceTelemetryBeanName.toString(), this.getCheckName(),e);

} catch (MalformedObjectNameException | InstanceAlreadyExistsException
| MBeanRegistrationException | NotCompliantMBeanException e) {
log.warn("Could not register bean for instance: " + this.getCheckName(),e);
}

return bean;
Expand Down

0 comments on commit 7aaf2cb

Please sign in to comment.