Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch metrics for java.lang.Object attributes #118

Closed
benrudolph opened this issue Jan 2, 2017 · 1 comment
Closed

Fetch metrics for java.lang.Object attributes #118

benrudolph opened this issue Jan 2, 2017 · 1 comment

Comments

@benrudolph
Copy link

I'm trying to fetch attributes that are java.lang.Object which seem to be supported based off of this. The issue is the collector crashes when trying to collect that attribute. Here is the output of a Data attribute for Spring actuator using the jmxterm-1.0-DATADOG-uber.jar:

$>bean
org.springframework.boot:type=Endpoint,name=metricsEndpoint
$>get Data
#mbean = org.springframework.boot:type=Endpoint,name=metricsEndpoint:
Data = {
  mem = 1241887;
  mem.free = 233668;
  processors = 4;
  instance.uptime = 243348342;
  uptime = 243367358;
  systemload.average = 1.95;
  heap.committed = 1159168;
  heap.init = 63168;
  heap.used = 925499;
  heap = 3262464;
  nonheap.committed = 83456;
  nonheap.init = 24000;
  nonheap.used = 82719;
  nonheap = 133120;
  threads.peak = 49;
  threads.daemon = 40;
  threads.totalStarted = 1727;
  threads = 44;
  classes = 12401;
  classes.loaded = 12561;
  classes.unloaded = 160;
  gc.ps_scavenge.count = 6604;
  gc.ps_scavenge.time = 143260;
  gc.ps_marksweep.count = 103;
  gc.ps_marksweep.time = 54414;
  httpsessions.max = -1;
  httpsessions.active = 0;
  datasource.primary.active = 0;
  datasource.primary.usage = 0.0;
  datasource.hq.active = 0;
  datasource.hq.usage = 0.0;
  counter.status.200.answer = 15249;
  counter.status.200.delete-incomplete-form = 1;
  counter.status.200.delete_application_dbs = 57;
  counter.status.200.formatted_questions = 4;
  counter.status.200.get_sessions = 31;
  counter.status.200.incomplete-form = 19;
  counter.status.200.navigate_menu = 1751;
  counter.status.200.serverup = 4128;
  counter.status.200.submit-all = 512;
  counter.status.200.sync-db = 18;
  counter.status.200.validate_form = 241;
  gauge.response.answer = 621.0;
  gauge.response.delete-incomplete-form = 22.0;
  gauge.response.delete_application_dbs = 25.0;
  gauge.response.formatted_questions = 249.0;
  gauge.response.get_sessions = 7679.0;
  gauge.response.incomplete-form = 8206.0;
  gauge.response.navigate_menu = 417.0;
  gauge.response.serverup = 1.0;
  gauge.response.submit-all = 11387.0;
  gauge.response.sync-db = 7330.0;
  gauge.response.validate_form = 17.0;
 };

All of which seem to be doubles that should be parsable by jmxfetch. My conf for this bean is:

- include:
          bean:
            - org.springframework.boot:type=Endpoint,name=metricsEndpoint
          attribute:
            - Data

The jmxfetch process finds the value when I use /etc/init.d/datadog-agent jmx list_matching_attributes, and in the jmxfetch.log I get this error:

2017-01-02 08:24:23,095 | WARN | JMXAttribute | Unable to get metrics from org.springframework.boot:type=Endpoint,name=metricsEndpoint - Data
java.lang.NumberFormatException
        at org.datadog.jmxfetch.JMXAttribute.getValueAsDouble(JMXAttribute.java:250)
        at org.datadog.jmxfetch.JMXSimpleAttribute.getValue(JMXSimpleAttribute.java:103)
        at org.datadog.jmxfetch.JMXSimpleAttribute.getMetrics(JMXSimpleAttribute.java:32)
        at org.datadog.jmxfetch.JMXAttribute.getMetricsCount(JMXAttribute.java:185)
        at org.datadog.jmxfetch.Instance.getMatchingAttributes(Instance.java:256)
        at org.datadog.jmxfetch.Instance.init(Instance.java:133)
        at org.datadog.jmxfetch.App.init(App.java:354)
        at org.datadog.jmxfetch.App.main(App.java:92)

Any insight into how to configure the yaml file to properly read this would be very helpful. Thank you!

@yannmh
Copy link
Member

yannmh commented Feb 13, 2017

I apologize for the late answer @benrudolph. Here is how you would do it:

- include:
          bean:
            - org.springframework.boot:type=Endpoint,name=metricsEndpoint
          attribute:
            - Data.mem
            - Data.classes
            [...]

If this is not, please send us a flare, so we can troubleshoot and get back to you faster. I am closing this issue in the meantime. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants