-
Notifications
You must be signed in to change notification settings - Fork 225
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
Hapi Instrumentation does not Capture Request Body #1905
Comments
Hapi doesn't seem to extend
|
A slight digression on request body capture. When I started looking at this I noticed that the Hapi Request object provides a function onPreAuth (request, reply) {
...
request.events.on('peek', function (chunk, encoding) {
console.warn('XXX request "peek" event', chunk, encoding)
})
... Theoretically this could be used to capture the raw HTTP request body. However, this isn't the general way we capture the body for other frameworks (e.g. Express). Instead the other existing instrumentation lets the framework/app parse the request body, and the APM instrumentation looks for the parsed body set to |
The body of incoming requests to an HTTP server using the Hapi framework will be recorded in relevant APM transaction and error objects depending on the `captureBody` config var setting. Closes: #1905
The body of incoming requests to an HTTP server using the Hapi framework will be recorded in relevant APM transaction and error objects depending on the `captureBody` config var setting. The testing of a POST to a hapi server also showed that older hapi versions are broken (hangs or crashes) with node >= 16, so this change adjusts the version combinations against which we test. Closes: #1905
Unsure if this is an enhancement request or a bug report, but it looks like our HAPI instrumentation does not collect the request bodies as captured by the built-in HAPI payload handling. HAPI populates
request.payload.name
with these values, but we read our request bodies in from the native nodeIncomeingMessage/Request
object (i.e.req.body
)You can observe this behavior by running the following small sample program
and posting some form variables.
HAPI captures the request body, but if you examine the generated transactions, no request body is captured.
Ideally our HAPI instrumentation should match our express instrumentation's functionality and capture these values.
The text was updated successfully, but these errors were encountered: