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

Added list_jvms option to list available JVMs (that this process can … #100

Closed
wants to merge 6 commits into from
Closed

Added list_jvms option to list available JVMs (that this process can … #100

wants to merge 6 commits into from

Conversation

cslee00
Copy link
Contributor

@cslee00 cslee00 commented May 14, 2016

Add list_jvms to show JVMs available for use by process_name_regex. Improve diagnostic message when no matching JVM found.

Also requires change to jmxfetch.py script to allow this option.

@yannmh
Copy link
Member

yannmh commented May 25, 2016

That's a great addon, thanks a lot @cslee00.

I am adding the PR to the next milestone: it'll get reviewed soon, and merged with Datadog Agent 5.9.0.

@yannmh yannmh self-assigned this May 25, 2016
@yannmh yannmh added this to the 0.12.0 milestone May 25, 2016
for (com.sun.tools.attach.VirtualMachineDescriptor vmd : com.sun.tools.attach.VirtualMachine.list()) {
jvms.add( vmd.displayName() );
}
throw new IOException("Cannot find JVM matching regex: '" + processRegex + "'; available JVMs (for this user account): " + jvms );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yannmh
Copy link
Member

yannmh commented Jun 3, 2016

I just added a few nitpicks here and there. It looks great overall, I am looking forward to see it merged.

Thanks again @cslee00.

@cslee00
Copy link
Contributor Author

cslee00 commented Jun 4, 2016

Thanks, great feedback, incorporated those changes.

Build is failing on openjdk6/7 (buffer overflow), unable to determine how that is related to these changes.

}
throw new IOException("Cannot find JVM matching regex: " + processRegex);

throw new IOException("Cannot find JVM matching regex: '" + processRegex + "'; available JVMs (for this user account): " + jvms );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This log line is directly forwarded to the dd-agent info command, i.e.

    jmx
    ---
      - instance #foobar [ERROR]: "Cannot connect to instance process_regex: test Cannot find JVM matching regex: 'test'; available JVMs (for this user account): [org.datadog.jmxfetch.App --check jmx.yaml --check_period 15000 --conf_directory /etc/dd-agent/conf.d --log_level INFO --log_location /var/log/datadog/jmxfetch.log --reporter statsd:localhost:8125 --status_location /opt/datadog-agent/run/jmx_status.yaml collect]" collected 0 metrics
      - Collected 0 metrics, 0 events & 0 service checks

I think it's difficult to understand what it means when being agnostic to the code. What do you think about keeping the old message ? Alternatively the message could invite the user to run the list_jvms command to list all available JVMs.

@yannmh
Copy link
Member

yannmh commented Jun 17, 2016

I restarted the tests and it's now passing 💚 . I also added a few extra nitpicks, I'd appreciate having your thoughts on it :)

@yannmh yannmh modified the milestones: 0.12.0, 0.13.0 Sep 7, 2016
@yannmh yannmh mentioned this pull request Oct 26, 2016
@yannmh
Copy link
Member

yannmh commented Oct 26, 2016

Moving to #112. Thanks again @cslee00 !

@yannmh yannmh closed this Oct 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants