Capture Body in request errors is not working (Java agent)


(Pablo) #1

Hi,

I have APM 6.5 and java agent v1.
The agent is configured with -Delastic.apm.capture_body=errors
But in APM UI, when I go to errors tab, the body has the value [REDACTED].

Also i have configured the transaction_sample_rate with 0.1,
Does this setting affect to capture_body?


(Felix Barnsteiner) #2

Hi Pablo and thanks for checking out the Java agent!

Note that capture_body can currently only capture form parameters at the moment. See https://www.elastic.co/guide/en/apm/agent/java/current/config-http.html#config-capture-body.

Cheers,
Felix


(Pablo) #3

Sorry, I didn't understand you.

I have an aplication running with -Delastic.apm.capture_body=errors. This flag capture body request when that request is an error. But when i check that errors, bodies have [REDACTED] value.

When that body is captured?

Thanks for reply!


(Felix Barnsteiner) #4

That's correct. But it can't capture arbitrary request bodies like JSON documents sent to your server. It currently only works when the body contains a application/x-www-form-urlencoded request body.

What type of request bodies are you trying to capture?

Cheers,
Felix


(Pablo) #5

Thanks for reply, I thought that the all bodies from the request flagged as error was sent to APM.

I'm trying to capture an application/json body, now I've realized that is not supported. There are a way to get it?

Thanks for your help!