Skip to content

Change logging for ScopeEventFactory creation exception#1417

Merged
randomanderson merged 2 commits into
masterfrom
landerson/dont-log-eventfactory-error
May 1, 2020
Merged

Change logging for ScopeEventFactory creation exception#1417
randomanderson merged 2 commits into
masterfrom
landerson/dont-log-eventfactory-error

Conversation

@randomanderson
Copy link
Copy Markdown
Contributor

@randomanderson randomanderson commented Apr 30, 2020

Related to #1345 and similar to #1395

The datadog.trace.core.jfr.openjdk.ScopeEventFactory class not being available happens in multiple common cases:

  • Running without the agent
  • Many tests that don't add the jfr-openjdk dependency
  • JDK version < 8

Logging the exception creates the mistaken impression of an error and creates a lot of spam in the test logs.

@randomanderson randomanderson requested a review from a team as a code owner April 30, 2020 20:14
Class.forName("datadog.trace.core.jfr.openjdk.ScopeEventFactory").newInstance();
} catch (final ClassFormatError | ReflectiveOperationException | NoClassDefFoundError e) {
log.debug("Cannot create Openjdk JFR scope event factory", e);
log.debug("Profiling ScopeEvents is disabled");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: It seems to me that disabled would imply some deliberate uses action. Profiling ScopeEvents are not available?

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

Successfully merging this pull request may close these issues.

3 participants