Type to search.

Stacktrace configuration options

Serverless Observability

Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Stack

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

APM Agent .NET

The Elastic APM .NET agent enables you to trace the execution of operations in your .NET applications, sending performance metrics and errors to the Elastic APM server.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

APM Agent .NET 1.5+

The Elastic APM .NET agent enables you to trace the execution of operations in your .NET applications, sending performance metrics and errors to the Elastic APM server.

Availability

  • Generally available since 1.5

    This functionality is generally available and ready for production usage.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

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
ELASTIC_APM_APPLICATION_NAMESPACES ElasticApm:ApplicationNamespaces

APM Agent .NET 1.5+

The Elastic APM .NET agent enables you to trace the execution of operations in your .NET applications, sending performance metrics and errors to the Elastic APM server.

Availability

  • Generally available since 1.5

    This functionality is generally available and ready for production usage.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

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
ELASTIC_APM_EXCLUDED_NAMESPACES ElasticApm:ExcludedNamespaces

dynamic config

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
50 Integer
Environment variable name IConfiguration or Web.config key
ELASTIC_APM_STACK_TRACE_LIMIT ElasticApm:StackTraceLimit
Note

If you would like to turn off stack trace capturing only for spans, but still capture stack traces for errors, set the SpanStackTraceMinDuration (performance) config to -1.

dynamic config

In its default settings, the APM .NET 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 zero (regardless of the time unit), like 0ms, stack traces are collected for all spans. Setting it to a positive value, for example, 5ms, limits stack trace collection to spans with durations equal to or longer than the given value, for example, 5 milliseconds.

To turn off stack trace collection for spans completely, set this option to a negative value, like -1ms.

Supports the duration suffixes ms, s and m. Example: 5ms. The default unit for this option is ms

Default Type
5ms TimeDuration
Environment variable name IConfiguration or Web.config key
ELASTIC_APM_SPAN_STACK_TRACE_MIN_DURATION ElasticApm:SpanStackTraceMinDuration
Important

Use of SpanFramesMinDuration is deprecated. Use SpanStackTraceMinDuration.