From 7aaf2cbb29621792da470528228b65f8e24d02ca Mon Sep 17 00:00:00 2001 From: Scott Opell Date: Thu, 19 Oct 2023 18:11:03 +0000 Subject: [PATCH] Reverts unrelated changes to telemetry bean exception handling --- src/main/java/org/datadog/jmxfetch/Instance.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/datadog/jmxfetch/Instance.java b/src/main/java/org/datadog/jmxfetch/Instance.java index d5b93fef1..b0ebd48bf 100644 --- a/src/main/java/org/datadog/jmxfetch/Instance.java +++ b/src/main/java/org/datadog/jmxfetch/Instance.java @@ -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;