Core configuration optionsedit

ServiceNameedit

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.

The service name must conform to this regular expression: ^[a-zA-Z0-9 _-]+$. In less regexy terms: Your service name must only contain characters from the ASCII alphabet, numbers, dashes, underscores and spaces. Characters in service name which don’t match regular expression will be replaced by _ symbol.

Environment variable nameIConfiguration or Web.config key

ELASTIC_APM_SERVICE_NAME

ElasticApm:ServiceName

DefaultType

Name of the entry assembly

String

ServiceVersionedit

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 nameIConfiguration or Web.config key

ELASTIC_APM_SERVICE_VERSION

ElasticApm:ServiceVersion

DefaultType

Informational version of the entry assembly

String

Environment ( [1.1] Added in 1.1. )edit

The name of the environment 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 environment selector in the Kibana UI for more information.

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 nameIConfiguration or Web.config key

ELASTIC_APM_ENVIRONMENT

ElasticApm:Environment

DefaultType

See note below

String

On ASP.NET Core application the agent uses EnvironmentName from IHostingEnvironment as default environment name.

TransactionSampleRateedit

By default, the agent will sample every transaction (e.g. a request to your service). To reduce overhead and storage requirements, you can 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.

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.

Environment variable nameIConfiguration or Web.config key

ELASTIC_APM_TRANSACTION_SAMPLE_RATE

ElasticApm:TransactionSampleRate

DefaultType

1.0

Double

TransactionMaxSpans (performance) ( [1.1.1] Added in 1.1.1. )edit

Limits the amount of spans that are recorded per transaction. This is helpful in cases where 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.

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.

Environment variable nameIConfiguration key

ELASTIC_APM_TRANSACTION_MAX_SPANS

ElasticApm:TransactionMaxSpans

DefaultType

500

Integer

CentralConfig ( [1.1] Added in 1.1. )edit

If set to true, the agent makes periodic requests to the APM Server to fetch the latest APM Agent configuration.

Environment variable nameIConfiguration key

ELASTIC_APM_CENTRAL_CONFIG

ElasticApm:CentralConfig

DefaultType

true

Boolean