Open jcrobak opened 5 years ago
Hey @jcrobak , thanks for having opened an issue! We're looking into this and I'll keep you informed.
With #255, I've merged the change to the Instance.toString()
method in order to use the configured instance name if one has been provided. I've also released JMXFetch 0.33.1 to ship this change.
It will be available starting with the Datadog Agent 6.16.0 (PR: https://github.com/DataDog/datadog-agent/pull/4530) which should be released soon.
If you want to test it sooner, you can:
jmx_custom_jars
configuration field in the Datadog Agent to provide the path to e.g.
jmx_custom_jars:
Nnote that you can also use the environment variable `DD_JMX_CUSTOM_JARS` or that it could also be configured in a check: https://docs.datadoghq.com/integrations/java/?tab=host#configuration-options
Please let me know when you'll have the chance to test this!
We have two jmx config files that match (via autodiscovery) a single JVM. During startup, we sometime see errors in the datadog agent log like (note that there are two different checks,
check1
andcheck2
):Looking at App.java, two lines after that message, the instance is put in
brokenInstanceMap
:https://github.com/DataDog/jmxfetch/blob/f59dacea44d70f6b19a76a4360d752ef4c27b965/src/main/java/org/datadog/jmxfetch/App.java#L1032-L1036
In our case,
instance.toString()
resolves to${host}:${port}
, which is not unique across the two checks:https://github.com/DataDog/jmxfetch/blob/f59dacea44d70f6b19a76a4360d752ef4c27b965/src/main/java/org/datadog/jmxfetch/Instance.java#L395
We tried to set
Instance.getName()
to something unique (see below), but that didn't solve the problem becauseInstance.toString()
doesn't take into account the name...A workaround is to combine the two JMX check configs into a single file.