HTTP configuration optionsedit

CaptureBody (performance) ( [1.0.1] Added in 1.0.1. )edit

dynamic config

For transactions that are HTTP requests, the agent can optionally capture the request body, e.g., POST variables. If the request has a body and this setting is disabled, the body will be shown as [REDACTED]. This option is case-insensitive.

Request bodies often contain sensitive values like passwords, credit card numbers, etc. If your service handles data like this, we advise to only enable this feature with care. Turning on body capturing can also significantly increase the overhead in terms of heap usage, network utilization, and Elasticsearch index size.

Possible options are off, errors, transactions and all:

  • off - request bodies will never be reported
  • errors - request bodies will only be reported with errors
  • transactions - request bodies will only be reported with request transactions
  • all - request bodies will be reported with both errors and request transactions

This setting can be changed after agent’s start.

Environment variable name IConfiguration or Web.config key

ELASTIC_APM_CAPTURE_BODY

ElasticApm:CaptureBody

Default Type

off

String

CaptureBodyContentTypes (performance) ( [1.0.1] Added in 1.0.1. )edit

Configures which content types should be captured.

This option supports the wildcard *, which matches zero or more characters. Examples: /foo/*/bar/*/baz*, *foo*. Matching is case insensitive.

This setting can be changed after agent’s start.

Environment variable name IConfiguration or Web.config key

ELASTIC_APM_CAPTURE_BODY_CONTENT_TYPES

ElasticApm:CaptureBodyContentTypes

Default Type

application/x-www-form-urlencoded*, text/*, application/json*, application/xml*

List<string>

CaptureHeaders (performance)edit

dynamic config

Environment variable name IConfiguration or Web.config key

ELASTIC_APM_CAPTURE_HEADERS

ElasticApm:CaptureHeaders

Default Type

true

Boolean

If set to true, the agent will capture request and response headers, including cookies.

Setting this to false reduces memory allocations, network bandwidth and disk space used by Elasticsearch.

UseElasticTraceparentHeader ( [1.3.0] Added in 1.3.0. )edit

Environment variable name IConfiguration or Web.config key

ELASTIC_APM_USE_ELASTIC_TRACEPARENT_HEADER

ElasticApm:UseElasticTraceparentHeder

Default Type

true

Boolean

To enable distributed tracing, the agent adds trace context headers to outgoing HTTP requests made with the HttpClient type. These headers (traceparent and tracestate) are defined in the W3C Trace Context specification.

When this setting is true, the agent will also add the header elasticapm-traceparent for backwards compatibility with older versions of Elastic APM agents. Versions prior to 1.3.0 only read the elasticapm-traceparent header.