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

Refactor servlet instrumentation and disable async on response. #405

Merged
merged 2 commits into from
Jul 30, 2018

Conversation

tylerbenson
Copy link
Contributor

Separate out common advice between instrumentation.

Separate out common advice between instrumentation.
@tylerbenson tylerbenson added the inst: others All other instrumentations label Jul 25, 2018
@tylerbenson tylerbenson requested a review from realark July 25, 2018 05:13
Add context to servlet2 test.

Clean up some declared tracers that mess up the classpath.
@@ -62,137 +44,21 @@ public ElementMatcher typeMatcher() {
return new String[] {
"datadog.trace.instrumentation.jetty8.HttpServletRequestExtractAdapter",
"datadog.trace.instrumentation.jetty8.HttpServletRequestExtractAdapter$MultivaluedMapFlatIterator",
HandlerInstrumentationAdvice.class.getName() + "$TagSettingAsyncListener"
"datadog.trace.instrumentation.jetty8.TagSettingAsyncListener"
Copy link
Contributor

Choose a reason for hiding this comment

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

You could use package name of the current class here instead of hardcoding it as a string - this would make it easier if things move.

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 considered it, but there are many other places that could also be done. Seems like a better case for doing consistently in a single PR.

this.tags.remove(tag);
}
} else {
if (this.tags.isEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This whole idea with immutable empty hash for 'no tags' case seems like a premature optimization that just complicates code likely with not much of a real performance benefit if any. Maybe it is worth considering removing that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's already in place (and has been since the prototype). I'd rather not mess with that here. Perhaps a separate PR?

Copy link
Contributor

@mar-kolya mar-kolya left a comment

Choose a reason for hiding this comment

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

Couple of cosmetic comments

@tylerbenson tylerbenson merged commit 4e60246 into master Jul 30, 2018
@tylerbenson tylerbenson deleted the tyler/servlet-async branch July 30, 2018 00:27
@tylerbenson tylerbenson added this to the 0.12.0 milestone Aug 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inst: others All other instrumentations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants