HTTP configuration options
editHTTP configuration options
editCaptureBody
(performance) (
[1.0.1]
Added in 1.0.1.
)
editFor 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 |
---|---|
|
|
Default | Type |
---|---|
|
String |
CaptureBodyContentTypes
(performance) (
[1.0.1]
Added in 1.0.1.
)
editConfigures 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 |
---|---|
|
|
Default | Type |
---|---|
|
List<string> |
CaptureHeaders
(performance)
editIf 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 |
---|---|
|
|
Default | Type |
---|---|
|
Boolean |
TransactionIgnoreUrls
(performance)
editUsed 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 |
---|---|
|
|
Default | Type |
---|---|
|
List<string> |
UseElasticTraceparentHeader
(
[1.3.0]
Added in 1.3.0.
)
editTo 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 |
---|---|
|
|
Default | Type |
---|---|
|
Boolean |