Description
APM Agent version
1.20.0
Environment
Linux, Kubernetes, .NET 6, Web API
Describe the bug
I'd like to capture request body for failed transactions only so I set "CaptureBody": "errors"
in the application config file but the requests body is not captured and http.request.body.original is N/A
On the Errors tab http.request.body.original is [REDACTED]
However, the request body is captured both for failed and successful transactions if I set "CaptureBody": "all"
.
To Reproduce
Steps to reproduce the behavior:
- Create a basic api with a post action which accepts a model
- Make sure the action fails with an exception (unhandled) and 500 error code is returned
- Set
"CaptureBody": "errors"
- Call the action and pass a json to fill the model
- Verify that the response code is 500
Expected behavior
http.request.body.original contains the json passed when calling the action
Actual behavior
http.request.body.original is "N/A".
Again, it works as expected if CaptureBody is "all" and I can see http.request.body.original populated with actual request body both on Transactions and Errors tabs but I want request body for failed transactions or errors only.