DataDog / dd-agent

Datadog Agent Version 5
https://docs.datadoghq.com/
Other
1.3k stars 812 forks source link

JMX C3P0 integration not reporting some metrics #1486

Open msassak opened 9 years ago

msassak commented 9 years ago

I am configuring JMX integration with the DataDog agent, but some metrics related to C3P0 are not making it to the web interface. Other metrics work fine, including some from other parts of C3P0, but those are unfortunately not the C3P0 metrics I want.

There are no related errors in logs with the log level set to DEBUG, and the output of agent jmx collect includes the metrics I can't see on the web. After asking on IRC @MartinDatadog (Thanks, again!) gave me some help, but we were unable to figure out the problem, at which point he suggested opening an issue here.

Here's an excerpt from jmx.yaml:

  conf:
    - include:
       domain: java.nio
       type: BufferPool
       name: direct

    - include:
       domain: com.mchange.v2.c3p0
       type: C3P0Registry

    - include:
       domain: com.mchange.v2.c3p0
       type: PooledDataSource[1hge0x698u1bpwv1wvob7j|7c8f33d7]
       attribute:
         numIdleConnections:
           type: gauge
           alias: xxx.num_idle_connections

With this in place the standard JVM metrics are reported, as are java.nio.direct and and those under com.mchange.v2.c3p0[type=C3P0Registry]. The other C3P0 metrics under PooledDataSource (in this config only one to make debugging easier) never show up but are included in the output of agent jmx collect:

xxx.num_idle_connections[type:PooledDataSource[1hge0x698u1bpwv1wvob7j|7c8f33d7],instance:jmx-localhost-1234,jmx_domain:com.mchange.v2.c3p0] - 1427748093 = 8.0
jmx.com.mchange.v2.c3p0.num_pooled_data_sources[type:C3P0Registry,instance:jmx-localhost-1234,jmx_domain:com.mchange.v2.c3p0] - 1427748093 = 1.0
jmx.com.mchange.v2.c3p0.num_pools_all_data_sources[type:C3P0Registry,instance:jmx-localhost-1234,jmx_domain:com.mchange.v2.c3p0] - 1427748093 = 1.0
jmx.com.mchange.v2.c3p0.all_identity_token_count[type:C3P0Registry,instance:jmx-localhost-1234,jmx_domain:com.mchange.v2.c3p0] - 1427748093 = 3.0
jmx.com.mchange.v2.c3p0.all_identity_tokenized_count[type:C3P0Registry,instance:jmx-localhost-1234,jmx_domain:com.mchange.v2.c3p0] - 1427748093 = 3.0
jmx.com.mchange.v2.c3p0.all_pooled_data_sources_count[type:C3P0Registry,instance:jmx-localhost-1234,jmx_domain:com.mchange.v2.c3p0] - 1427748093 = 1.0

With this running I can work with jmx.com.mchange.v2.c3p0.num_pools_all_data_sources just fine, but xxx.num_idle_connections is never reported. I get the same result when trying to report all attributes and so on. It seems like everything underneath type:PooledDataSource[1hge0x698u1bpwv1wvob7j|7c8f33d7 is dropped along the way.

MartinDatadog commented 9 years ago

(Internal) https://datadog.desk.com/agent/case/35738 for more info

yannmh commented 9 years ago

Closing as following up through channel support. Please feel free to re-open if needed

msassak commented 9 years ago

This still doesn't work for me. I've just installed the newest agent on OS X, and the result is exactly the same: datadog-agent jmx list_matching_attributes includes the properties I want, but they don't show up in the Datadog web UI.

jhotta commented 9 years ago

(Internal) https://datadog.zendesk.com/agent/tickets/32841 for more info