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

Add servlet 2.2 instrumentation #376

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

kaushal02
Copy link

@kaushal02 kaushal02 commented Feb 3, 2023

Description

Adding instrumentation for old servlet versions (2.2-3.0). This is used in boomi. The implementation is almost similar to servlet-3.0.

Testing

Tested with rest API in boomi which uses servlet-2.5 and able to instrument everything there except response headers.

Checklist:

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

Documentation

Make sure that you have documented corresponding changes in this repository or hypertrace docs repo if required.

@kaushal02 kaushal02 marked this pull request as ready for review March 20, 2023 14:43
Copy link
Contributor

@shashank11p shashank11p left a comment

Choose a reason for hiding this comment

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

@kaushal02 there are some TODOs and FIXMEs pending

instrumentation/servlet/servlet-2.2/build.gradle.kts Outdated Show resolved Hide resolved
.and(isPublic()),
ServletOutputStreamInstrumentation.class.getName() + "$OutputStream_writeByteArrOffset");

// close() is not instrumented due to some issue with Tomcat
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we instrument this method in 2.0? We should check this method in servlet-2.0 code

javaagent/build.gradle.kts Outdated Show resolved Hide resolved
@shashank11p
Copy link
Contributor

@kaushal02 we should add tests as well

@@ -179,7 +178,6 @@ public static void exit(
VirtualField.find(HttpServletRequest.class, StringMapSpanPair.class);

// capture response body
// TODO: capture response headers
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we able to capture response headers?

Copy link
Author

Choose a reason for hiding this comment

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

we are capturing content-type header but other response headers are not getting captured, at least in case of Boomi

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.

2 participants