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

PROF-1622: Sample all exceptions #1559

Merged
merged 2 commits into from
Jun 11, 2020
Merged

Conversation

jbachorik
Copy link
Contributor

Capture all exceptions by instrumenting Throwable constructors so they can be subsampled.

It became obvious that there are libraries/applications using even Error types as a code flow control - generating 10s of thousands of error events. Therefore it makes sense to use the exception sampling facility to handle also errors and instrument the java.lang.Throwable constructor to get full coverage.

@jbachorik jbachorik requested review from a team as code owners June 8, 2020 17:03
Copy link
Contributor

@tylerbenson tylerbenson left a comment

Choose a reason for hiding this comment

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

Minor request to rename the class. Consider applying the rename to other places where it makes sense.

* don't instrument {@linkplain Error} class/subclasses since they are tracked by a native JFR event
* already.
*/
/** Provides instrumentation of {@linkplain Throwable} constructor. <br> */
@AutoService(Instrumenter.class)
public final class ExceptionInstrumentation extends Instrumenter.Default {
Copy link
Contributor

Choose a reason for hiding this comment

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

The class name should be renamed to match.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will rename only the advice and instrumentation classes since they deal with the exact class. The rest of the code is more about 'exceptions' as a concept rather than a concrete Java class and eg. ThrowableSampleEvent sounds strange, at least to me.

Capture all exceptions by instrumenting `Throwable` constructors so they can be subsampled
@jbachorik jbachorik force-pushed the jb/PROF-1622_sample_all_throwables branch from dfb476b to c2b9e02 Compare June 11, 2020 10:08
@jbachorik jbachorik merged commit d093a2a into master Jun 11, 2020
@jbachorik jbachorik deleted the jb/PROF-1622_sample_all_throwables branch June 11, 2020 10:36
@github-actions github-actions bot added this to the 0.55.0 milestone Jun 11, 2020
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.

None yet

4 participants