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.

To allow capturing request bodies, the agent sets AllowSynchronousIO to true on a per request basis in ASP.NET Core, since capturing can occur in synchronous code paths.

With ASP.NET Core 3.0 onwards, AllowSynchronousIO is false by default because a large number of blocking synchronous I/O operations can lead to thread pool starvation, which makes the application unresponsive. If your application becomes unresponsive with this feature enabled, consider disabling capturing.

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

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.

Environment variable name IConfiguration or Web.config key

ELASTIC_APM_CAPTURE_HEADERS

ElasticApm:CaptureHeaders

Default Type

true

Boolean

TransactionIgnoreUrls (performance)edit

dynamic config

Used to restrict requests to certain URLs from being instrumented.

This property should be set to a list containing one or more strings. When an incoming HTTP request is detected, its request path will be tested against each element in this list. For example, adding /home/index to this list would match and remove instrumentation from the following URLs:

https://www.mycoolsite.com/home/index
http://localhost/home/index
http://whatever.com/home/index?value1=123

This option supports the wildcard *, which matches zero or more characters. Examples: /foo/*/bar/*/baz*, *foo*. Matching is case insensitive by default. Prepending an element with (?-i) makes the matching case sensitive.

All errors that are captured during a request to an ignored URL are still sent to the APM Server regardless of this setting.

Environment variable name IConfiguration or Web.config key

ELASTIC_APM_TRANSACTION_IGNORE_URLS

ElasticApm:TransactionIgnoreUrls

Default Type

/VAADIN/*, /heartbeat*, /favicon.ico", *.js", *.css", *.jpg", *.jpeg", *.png", *.gif", *.webp", *.svg", *.woff", *.woff2

List<string>

UseElasticTraceparentHeader ( [1.3.0] Added in 1.3.0. )edit

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.

Environment variable name IConfiguration or Web.config key

ELASTIC_APM_USE_ELASTIC_TRACEPARENT_HEADER

ElasticApm:UseElasticTraceparentHeder

Default Type

true

Boolean