-
Notifications
You must be signed in to change notification settings - Fork 327
Capture text-based request bodies #498
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
Capture text-based request bodies #498
Conversation
…ad been interpreted wrong
…to improvement/capture-request-body Merge source repository with fork
The advantage of this approach is that we don't have to instrument java.io.InputStream which would affect much more than just the HttpServletRequest body. We only create a wrapper in case we want to capture the body so the effect on requests with disabled body capturing is minimal.
Remove call to readNBytes as it might throw an error if eagerly linked on Java 7
Codecov Report
@@ Coverage Diff @@
## master #498 +/- ##
============================================
- Coverage 64.32% 63.67% -0.65%
Complexity 68 68
============================================
Files 175 178 +3
Lines 6548 6687 +139
Branches 753 765 +12
============================================
+ Hits 4212 4258 +46
- Misses 2082 2171 +89
- Partials 254 258 +4
Continue to review full report at Codecov.
|
eyalkoren
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
Unrelated, but looks important - shouldn't Request#charBufferPool be static 😮?
apm-agent-core/src/main/java/co/elastic/apm/agent/matcher/WildcardMatcher.java
Show resolved
Hide resolved
...plugin/src/main/java/co/elastic/apm/agent/servlet/RequestStreamRecordingInstrumentation.java
Outdated
Show resolved
Hide resolved
...plugin/src/main/java/co/elastic/apm/agent/servlet/RequestStreamRecordingInstrumentation.java
Show resolved
Hide resolved
...t-plugin/src/main/java/co/elastic/apm/agent/servlet/helper/InputStreamFactoryHelperImpl.java
Show resolved
Hide resolved
...in/src/main/java/co/elastic/apm/agent/servlet/helper/RecordingServletInputStreamWrapper.java
Show resolved
Hide resolved
.../apm-servlet-plugin/src/test/java/co/elastic/apm/agent/servlet/TestRequestBodyCapturing.java
Outdated
Show resolved
Hide resolved
.../apm-servlet-plugin/src/test/java/co/elastic/apm/agent/servlet/TestRequestBodyCapturing.java
Outdated
Show resolved
Hide resolved
.../apm-servlet-plugin/src/test/java/co/elastic/apm/agent/servlet/TestRequestBodyCapturing.java
Show resolved
Hide resolved
...in/src/main/java/co/elastic/apm/agent/servlet/helper/RecordingServletInputStreamWrapper.java
Show resolved
Hide resolved
integration-tests/simple-webapp/src/main/java/co/elastic/webapp/EchoServlet.java
Show resolved
Hide resolved
...t-plugin/src/main/java/co/elastic/apm/agent/servlet/helper/InputStreamFactoryHelperImpl.java
Outdated
Show resolved
Hide resolved
...n-server-integration-tests/src/test/java/co/elastic/apm/servlet/tests/ServletApiTestApp.java
Outdated
Show resolved
Hide resolved
|
@nowachri-de could you sign the CLA? Do you know why the commits are from |
|
@nowachri-de Maybe you need to register the email address you have configured for git in GitHub (see https://github.com/elastic/apm-agent-java/pull/498.patch). |

closes #449