Note
|
For the best reading experience, please view this documentation at elastic.co. |
Utilize configuration options to adapt the Elastic APM agent to your needs. There are multiple configuration sources, each with different naming conventions for the property key.
By default, the agent uses environment variables. Additionally, on ASP.NET Core, the agent can plug into the Microsoft.Extensions.Configuration infrastructure.
Configuration options that are marked with the badge can be changed at runtime when set from a supported source.
The .NET Agent supports {apm-app-ref}/agent-configuration.html[Central configuration],
which allows you to fine-tune certain configurations via the APM app.
This feature is enabled in the Agent by default, with CentralConfig
(added[1.1]).
The UseElasticApm()
extension method offers an overload to pass an IConfiguration
instance to the APM Agent.
To use this type of setup, which is typical in an ASP.NET Core application, your application’s Startup.cs
file should contain code similar to the following:
using Elastic.Apm.AspNetCore;
public class Startup
{
private readonly IConfiguration _configuration;
public Startup(IConfiguration configuration)
{
_configuration = configuration;
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
//Registers the agent with an IConfiguration instance:
app.UseElasticApm(_configuration);
//Rest of the Configure() method...
}
}
With this setup, the Agent is able to be configured in the same way as any other library in your application.
For example, any configuration source that has been configured on the IConfiguration
instance being passed to the APM Agent can be used to set Agent configuration values.
More information is available in the official Microsoft .NET Core configuration docs
You can find the key for each APM configuration option in this documentation, under the IConfiguration or Web.config key
column of the option’s description.
Note
|
It is also possible to call UseElasticApm() without the overload. In this case, the agent will only read configurations from environment variables.
|
Note
|
The UseElasticApm method only turns on ASP.NET Core monitoring. To turn on tracing for everything supported by the Agent on .NET Core, including HTTP and database monitoring, use the UseAllElasticApm method from the Elastic.Apm NetCoreAll package. Learn more in ASP.NET Core setup.
|
Here is a sample appsettings.json
configuration file for a typical ASP.NET Core application that has been activated with UseElasticApm()
. There are two important takeaways, which are listed as callouts below the example:
{
"Logging": {
"LogLevel": { (1)
"Default": "Warning",
"Elastic.Apm": "Debug"
}
},
"AllowedHosts": "*",
"ElasticApm": (2)
{
"ServerUrl": "http://myapmserver:8200",
"SecretToken": "apm-server-secret-token",
"TransactionSampleRate": 1.0
}
}
-
With ASP.NET Core, you must set
LogLevel
for the internal APM logger in the standardLogging
section with theElastic.Apm
category name. -
The configurations below
ElasticApm
are fetched by the agent if the correspondingIConfiguration
is passed to the agent.
In certain scenarios—like when you’re not using ASP.NET Core—you won’t activate the agent with the UseElasticApm()
method.
In this case, set the agent log level with ElasticApm:LogLevel
, as shown in the following appsettings.json
file:
{
"Logging": {
"LogLevel": {
"Default": "Warning"
}
},
"AllowedHosts": "*",
"ElasticApm":
{
"LogLevel": "Debug",
"ServerUrl": "http://myapmserver:8200",
"SecretToken": "apm-server-secret-token",
"TransactionSampleRate": 1.0
}
}
Configuration for Windows services can be provided by setting environment variables for the specific Windows service in the Windows registry. With PowerShell
$environment = [string[]]@(
"ELASTIC_APM_SERVER_URL=http://localhost:8200", (1)
"ELASTIC_APM_TRANSACTION_SAMPLE_RATE=1",
"ELASTIC_APM_ENVIRONMENT=Production",
"ELASTIC_APM_SERVICE_NAME=MyWindowsService")
Set-ItemProperty HKLM:SYSTEM\CurrentControlSet\Services\<service-name> -Name Environment -Value $environment (2)
-
define the environment variables to use for the Windows service
-
<service-name>
is the name of the Windows service.
The service must then be restarted for the change to take effect
Restart-Service <service-name>
When monitoring ASP.NET applications the agent uses two sources of configuration:
-
Web.config
<appSettings>
section -
Environment variables
Web.config takes precedence over environment variables which means that the agent tries first to find a configuration option value by its key in Web.config. If it’s not present, then the agent tries to look for it among environment variables. If it’s not present, the agent falls back to the options default value.
You can find the key of each configuration option
in the IConfiguration or Web.config key
column of the corresponding option’s description.
Below is a sample Web.config
configuration file for a ASP.NET application.
<?xml version="1.0" encoding="utf-8"?>
<!-- ... -->
<configuration>
<!-- ... -->
<appSettings>
<!-- ... -->
<add key="ElasticApm:ServerUrl" value="https://my-apm-server:8200" />
<add key="ElasticApm:SecretToken" value="apm-server-secret-token" />
<!-- ... -->
</appSettings>
<!-- ... -->
</configuration>
Additionally, on ASP.NET, you can implement your own configuration reader. To do this, implement the IConfigurationReader
interface from the Elastic.Apm.Config
namespace.
Once implemented, you can use the FullFrameworkConfigurationReaderType
setting.
This setting is .NET Full Framework only.
This setting can point an agent to a custom IConfigurationReader
implementation and the agent will read configuration from your IConfigurationReader
implementation.
Use type name in AssemblyQualifiedName format (e.g: MyClass, MyNamespace
).
Environment variable name | Web.config key |
---|---|
|
|
Default | Type |
---|---|
None |
String |
If this setting is set in both the web.config file and as an environment variable, then the web.config file has precedence.
A Boolean specifying if the agent should be recording or not. When recording, the agent captures HTTP requests, tracks errors, and collects and sends metrics. When not recording, the agent works as a noop, where it does not collect data or communicate with the APM server, except for polling the central configuration endpoint. This is a reversible switch, so the agent threads are not killed when deactivated, but they will be mostly idle in this state, so the overhead should be negligible.
Use this setting to dynamically disable Elastic APM at runtime.
Warning
|
Setting Recording to false influences the behavior of the [public-api]. When the agent is not active, it won’t keep track of transactions, spans, and any related properties.
|
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Default | Type |
---|---|
|
Boolean |
Setting this to false
will completely disable the agent, including instrumentation and remote config polling.
If you want to dynamically change the status of the agent, use recording
instead.
Warning
|
Setting Enabled to false influences the behavior of the [public-api]. When the agent is not active, it won’t keep track of transactions, spans, and any related properties.
|
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Default | Type |
---|---|
|
Boolean |
This is used to keep all the errors and transactions of your service together and is the primary filter in the Elastic APM user interface.
Note
|
The service name must conform to this regular expression: ^[a-zA-Z0-9 -]+$ . In other words, your service name must only contain characters from the ASCII alphabet, numbers, dashes, underscores, and spaces. Characters in service names that don’t match the regular expression will be replaced with the symbol.
|
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Default | Type |
---|---|
Name of the entry assembly |
String |
This is an optional name used to differentiate between nodes in a service. If this is not set, data aggregations are done based on a container ID (where valid) or on the reported hostname (automatically discovered).
Note
|
This feature requires APM Server versions >= 7.5 |
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Default | Type |
---|---|
|
String |
A version string for the currently deployed version of the service. If you don’t
version your deployments, the recommended value for this field is the commit identifier
of the deployed revision, e.g. the output of git rev-parse HEAD
.
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Default | Type |
---|---|
Informational version of the entry assembly |
String |
This allows for the reported hostname to be manually specified. If this is not set, the hostname will be looked up.
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Default | Type |
---|---|
|
String |
The name of the environment that this service is deployed in, e.g. "production" or "staging".
Environments allow you to easily filter data on a global level in the APM app. It’s important to be consistent when naming environments across agents. See {apm-app-ref}/filters.html#environment-selector[environment selector] in the Kibana UI for more information.
Note
|
This feature is fully supported in the APM app in Kibana versions >= 7.2. You must use the query bar to filter for a specific environment in versions prior to 7.2. |
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Default | Type |
---|---|
See note below |
String |
Note
|
On ASP.NET Core application the agent uses EnvironmentName from IHostingEnvironment as default environment name. |
By default, the agent samples every transaction (e.g. a request to your service). To reduce overhead and storage requirements, set the sample rate to a value between 0.0 and 1.0. The agent will still record the overall time and result for unsampled transactions, but no context information, labels, or spans will be recorded.
Note
|
When parsing the value for this option, the agent doesn’t consider the current culture.
It also expects that a period (. ) is used to separate the integer and the fraction of a floating-point number.
|
This setting can be changed after the agent starts.
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Default | Type |
---|---|
1.0 |
Double |
This limits the amount of spans that are recorded per transaction. This is helpful when a transaction creates a very high amount of spans, for example, thousands of SQL queries. Setting an upper limit helps prevent overloading the Agent and APM server in these edge cases.
Note
|
A value of 0 means that spans will never be collected.
Setting -1 means that spans will never be dropped.
The Agent will revert to the default value if the value is set below -1 .
|
This setting can be changed after agent starts.
Environment variable name | IConfiguration key |
---|---|
|
|
Default | Type |
---|---|
|
Integer |
If set to true
, the agent makes periodic requests to the APM Server to fetch
the latest {apm-app-ref}/agent-configuration.html[APM Agent configuration].
Environment variable name | IConfiguration key |
---|---|
|
|
Default | Type |
---|---|
true |
Boolean |
Sometimes it is necessary to sanitize, i.e., remove, sensitive data sent to Elastic APM.
This config accepts a list of wildcard patterns of field names which should be sanitized.
These apply to HTTP headers and application/x-www-form-urlencoded
data.
Important
|
This setting only applies to values that are captured automatically by the agent. If you capture the request body manually with the public API, this configuration doesn’t apply, and the agent won’t sanitize the body. |
The wildcard, , matches zero or more characters, and matching is case insensitive by default.
Prepending an element with
(?-i)
makes the matching case sensitive.
Examples: /foo/
/bar//baz
, foo
.
Please be sure to review the data captured by Elastic APM carefully to make sure it does not contain sensitive information. If you do find sensitive data in your {es} index, add an additional entry to this list. Setting a value here will overwrite the defaults, so be sure to include the default entries as well.
Note
|
Sensitive information should not be sent in the query string. Data in the query string is considered non-sensitive. See owasp.org for more information. |
Environment variable name | IConfiguration key |
---|---|
|
|
Default | Type |
---|---|
|
Comma separated string |
Labels are added to all events with the format key=value[,key=value[,…]]
.
Any labels set by the application via the agent’s public API will override global labels with the same keys.
Environment variable name | IConfiguration key |
---|---|
|
|
Default | Type |
---|---|
<empty map> |
Map of string to string |
Note
|
This option requires APM Server 7.2 or later. It will have no effect on older versions. |
Setting this option to true will enable span compression feature. Span compression reduces the collection, processing, and storage overhead, and removes clutter from the UI. The tradeoff is that some information such as DB statements of all the compressed spans will not be collected.
Environment variable name | IConfiguration key |
---|---|
|
|
Default | Type |
---|---|
|
Boolean |
Consecutive spans that are exact match and that are under this threshold will be compressed into a single composite span. This option does not apply to composite spans. This reduces the collection, processing, and storage overhead, and removes clutter from the UI. The tradeoff is that the DB statements of all the compressed spans will not be collected.
Environment variable name | IConfiguration key |
---|---|
|
|
Default | Type |
---|---|
|
TimeDuration |
Consecutive spans to the same destination that are under this threshold will be compressed into a single composite span. This option does not apply to composite spans. This reduces the collection, processing, and storage overhead, and removes clutter from the UI. The tradeoff is that the DB statements of all the compressed spans will not be collected.
Environment variable name | IConfiguration key |
---|---|
|
|
Default | Type |
---|---|
|
TimeDuration |
Sets the minimum duration of exit spans. Exit spans with a duration lesser than this threshold are attempted to be discarded. If the exit span is equal or greater the threshold, it should be kept. In some cases exit spans cannot be discarded. For example, spans that propagate the trace context to downstream services, such as outgoing HTTP requests, can’t be discarded. However, external calls that don’t propagate context, such as calls to a database, can be discarded using this threshold. Additionally, spans that lead to an error can’t be discarded.
Environment variable name | IConfiguration key |
---|---|
|
|
Default | Type |
---|---|
|
TimeDuration |
The URL for your APM Server. The URL must be fully qualified, including protocol (http
or https
) and port.
Important
|
Use of ServerUrls is deprecated. Use ServerUrl .
|
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Default | Type |
---|---|
String |
A string used to ensure that only your agents can send data to your APM server.
Both the agents and the APM server have to be configured with the same secret token. Use this setting if the APM Server requires a secret token, for example, when using our hosted {es} Service on Elastic Cloud.
Warning
|
The SecretToken is sent as plain-text in every request to the server, so you should also secure
your communications using HTTPS. Unless you do so, your API Key could be observed by an attacker.
|
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Default | Type |
---|---|
|
String |
A base64-encoded string used to ensure that only your agents can send data to your APM server. You must have created the API key using the APM server’s {apm-guide-ref}/api-key.html[command line tool].
Note
|
This feature is fully supported in the APM Server versions >= 7.6. |
Warning
|
The APIKey is sent as plain-text in every request to the server, so you should also secure
your communications using HTTPS. Unless you do so, your API Key could be observed by an attacker.
|
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Default | Type |
---|---|
|
A base64-encoded string |
By default, the agent verifies the SSL certificate if you use an HTTPS connection to the APM server.
Verification can be disabled by changing this setting to false.
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Default | Type |
---|---|
|
Boolean |
The path to a PEM-encoded certificate used for SSL/TLS by APM server. Used to perform validation through certificate pinning.
This can be specified when using a certificate signed by a Certificate Authority (CA) that is not in the trust store, such as a self-signed certificate.
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Default | Type |
---|---|
|
String |
The maximal amount of time events are held in the queue until there is enough to send a batch.
It’s possible for a batch to contain less than MaxBatchEventCount
events
if there are events that need to be sent out because they were held for too long.
A lower value will increase the load on your APM server,
while a higher value can increase the memory pressure on your app.
A higher value also impacts the time until transactions are indexed and searchable in Elasticsearch.
Supports the duration suffixes ms
, s
and m
.
Example: 30s
.
The default unit for this option is s
.
If FlushInterval
is set to 0
(or 0s
, 0ms
, etc.) and
there’s no event sending operation still in progress,
then the Agent won’t hold events in the queue and will send them immediately.
Setting FlushInterval
to a negative value (for example -1
, -54s
, -89ms
, etc.) is invalid and
in that case agent uses the default value instead.
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Default | Type |
---|---|
|
TimeDuration |
The maximum number of events to send in a batch.
It’s possible for a batch to contain less then the maximum events
if there are events that need to be sent out because they were held for too long
(see FlushInterval
).
Setting MaxBatchEventCount
to 0
or a negative value is invalid and
the Agent will use the default value instead.
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Default | Type |
---|---|
10 |
Integer |
The maximum number of events to hold in the queue as candidates to be sent. If the queue is at its maximum capacity then the agent discards the new events until the queue has free space.
Setting MaxQueueEventCount
to 0
or a negative value is invalid and the Agent will use the default value instead.
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Default | Type |
---|---|
1000 |
Integer |
The interval at which the agent sends metrics to the APM Server.
This must be at least 1s
.
Set this to 0s
to deactivate.
Supports the duration suffixes ms
, s
and m
.
Example: 30s
.
The default unit for this option is s
.
Default | Type |
---|---|
|
TimeDuration |
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
This disables the collection of certain metrics. If the name of a metric matches any of the wildcard expressions, it will not be collected. Example: foo.,bar.
You can find the name of the available metrics in [metrics].
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.
Default | Type |
---|---|
<none> |
Comma separated string |
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Specify which cloud provider should be assumed for metadata collection. By default, the agent attempts to detect the cloud provider and, if that fails, uses trial and error to collect the metadata.
Valid options are "auto"
, "aws"
, "gcp"
, "azure"
, and "none"
. If this config value is set to "none"
, no cloud metadata will be collected. If set to any of
"aws"
, "gcp"
, or "azure"
, attempts to collect metadata will only be performed
from the chosen provider.
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Default | Type |
---|---|
|
String |
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.
Important
|
To allow capturing request bodies, the agent sets With ASP.NET Core 3.0 onwards, |
Warning
|
Request bodies often contain sensitive values like passwords and credit card numbers. 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 the agent starts.
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Default | Type |
---|---|
|
String |
Configures the content types to 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 the agent starts.
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Default | Type |
---|---|
|
Comma separated string |
If set to true
,
the agent will capture request and response headers, including cookies.
Note
|
Setting this to false reduces memory allocations, network bandwidth, and disk space used by {es}.
|
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Default | Type |
---|---|
|
Boolean |
Valid options: continue
, restart
, restart_external
.
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Default | Type |
---|---|
|
String |
The traceparent
header of requests that are traced by the Elastic APM .NET Agent might have been added by a 3rd party component.
This situation becomes more and more common as the w3c trace context gets adopted. In such cases you may end up with traces where part of the trace is outside of Elastic APM.
In order to handle this properly, the agent offers trace continuation strategies with the following values and behavior:
-
continue
: The agent takes thetraceparent
header as it is and applies it to the new transaction. -
restart
: The agent always creates a new trace with a new trace id. In this case the agent creates a span link in the new transaction pointing to the originaltraceparent
. -
restart_external
: The agent first checks thetracestate
header. If the header contains thees
vendor flag (which means the request is coming from a service monitored by an Elastic APM Agent), it’s treated as internal, otherwise (including the case when thetracestate
header is not present) it’s treated as external. In case of external calls the agent creates a new trace with a new trace id and creates a link in the new transaction pointing to the original trace.
This is used to restrict requests to certain URLs from being instrumented.
This property should be set to a comma separated string containing one or more paths.
For example, in order to ignore the URLs /foo
and /bar
, set the configuration value to "/foo,/bar"
.
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
In other words, the matching always happens based on the request path—hosts and query strings are ignored.
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.
Note
|
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 |
---|---|
|
Comma separated string |
Note
|
Changing this configuration will overwrite the default value. |
To enable {apm-guide-ref}/apm-distributed-tracing.html[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 also adds 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 |
Important
|
Use of TraceContextIgnoreSampledFalse is deprecated. Use TraceContinuationStrategy with the restart_external value.
|
The agent uses the W3C Trace Context specification and standards for distributed tracing. The traceparent header from the W3C Trace Context specification defines a sampled flag which is propagated from a caller service to a callee service, and determines whether a trace is sampled in the callee service. The default behavior of the agent honors the sampled flag value and behaves accordingly.
There may be cases where you wish to change the default behavior of the agent with respect to the sampled flag. By setting the TraceContextIgnoreSampled
configuration value to true
, the agent ignores the sampled flag of the W3C Trace Context traceparent header when it has a value of false
and and there is no agent specific tracestate header value present. In ignoring the sampled flag, the agent makes a sampling decision based on the sample rate. This can be useful when a caller service always sets a sampled flag value of false
, that results in the agent never sampling any transactions.
Important
|
.NET 5 applications set the W3C Trace Context for outgoing HTTP requests by default, but with the traceparent header sampled flag set to If your application is called by an .NET 5 application that does not have an active agent, setting the |
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Default | Type |
---|---|
|
Boolean |
Used to filter out specific messaging queues/topics/exchanges from being traced. When set, sends-to and receives-from the specified queues/topics/exchanges will be ignored.
This config accepts a comma separated string of wildcard patterns of queues/topics/exchange names which should be ignored.
The wildcard, , matches zero or more characters, and matching is case insensitive by default.
Prepending an element with
(?-i)
makes the matching case sensitive.
Examples: /foo/
/bar//baz
, foo
.
Default | Type |
---|---|
<empty string> |
String |
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
This is used to determine whether a stack trace frame is an in-app frame or a library frame. When defined, all namespaces that do not start with one of the values of this collection are ignored when determining error culprit.
Multiple namespaces can be configured as a comma separated list. For example: "MyAppA, MyAppB"
.
This suppresses any configuration of ExcludedNamespaces
.
Default | Type |
---|---|
<empty string> |
String |
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
A list of namespaces to exclude when reading an exception StackTrace to determine the culprit.
Namespaces are checked with string.StartsWith()
, so "System." matches all System namespaces.
Default | Type |
---|---|
"System., Microsoft., MS., FSharp., Newtonsoft.Json, Serilog, NLog, Giraffe." |
String |
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Setting this to 0
disables stack trace collection. Any positive integer value will be used as the maximum number of frames to collect. Setting it to -1 means that all frames will be collected.
Default | Type |
---|---|
|
Integer |
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Note
|
If you would like to disable stack trace capturing only for spans, but still capture stack traces for errors, set the SpanFramesMinDuration (performance) config to 0 .
|
In its default settings,
the APM agent collects a stack trace for every recorded span with duration longer than 5ms
.
While this is very helpful to find the exact place in your code that causes the span,
collecting this stack trace does have some overhead.
When setting this option to a negative value, like -1ms
, stack traces are collected for all spans.
Setting it to a positive value, e.g. 5ms
,
limits stack trace collection to spans with durations equal to or longer than the given value,
e.g. 5 milliseconds.
To disable stack trace collection for spans completely, set the value to 0ms
.
Supports the duration suffixes ms
, s
and m
.
Example: 5ms
.
The default unit for this option is ms
Default | Type |
---|---|
|
TimeDuration |
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Sets the logging level for the agent.
Valid options: Critical
, Error
, Warning
, Info
, Debug
, Trace
and None
(None
disables the logging).
Important
|
The UseElasticApm() extension offers an overload to pass an IConfiguration instance to the agent.
When configuring your agent in this way, as is typical in an ASP.NET Core application,
you must instead set the LogLevel for the internal APM logger under the Logging section of appsettings.json . More details, including a sample configuration file are available in Configuration on ASP.NET Core.
|
Environment variable name | IConfiguration or Web.config key |
---|---|
|
|
Default | Type |
---|---|
|
String |