Supportability configuration optionsedit

LogLeveledit

dynamic config

Sets the logging level for the agent.

Valid options: Critical, Error, Warning, Info, Debug, Trace and None (None disables the logging).

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

ELASTIC_APM_LOG_LEVEL

ElasticApm:LogLevel

Default Type

Error

String

TraceContextIgnoreSampledFalseedit

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.

.NET 5 applications set the W3C Trace Context for outgoing HTTP requests by default, but with the traceparent header sampled flag set to false. If a .NET 5 application has an active agent, the agent ensures that the sampled flag is propagated with the agent’s sampling decision. If a .NET 5 application does not have an active agent however, and the application calls another service that does have an active agent, the propagation of a sampled flag value of false results in no sampled transactions in the callee service.

If your application is called by an .NET 5 application that does not have an active agent, setting the TraceContextIgnoreSampledFalse configuration value to true instructs the agent to start a new transaction and make a sampling decision based on the sample rate, when the traceparent header sampled flag has a value of false and there is no agent specific tracestate header value present.

Environment variable name IConfiguration or Web.config key

TRACE_CONTEXT_IGNORE_SAMPLED_FALSE

ElasticApm:TraceContextIgnoreSampledFalse

Default Type

false

Boolean