Movatterモバイル変換


[0]ホーム

URL:


Loading

Configuration on ASP.NET

Serverless ObservabilityStackAPM Agent .NET

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 theIConfiguration or Web.config key column of the corresponding option’s description.

Below is a sampleWeb.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 theIConfigurationReader interface from theElastic.Apm.Config namespace. Once implemented, you can use theFullFrameworkConfigurationReaderType setting.

This setting is .NET Full Framework only.

This setting can point an agent to a customIConfigurationReader implementation and the agent will read configuration from yourIConfigurationReader implementation.

Use type name inAssemblyQualifiedName format (e.g:MyClass, MyNamespace).

Environment variable nameWeb.config key
ELASTIC_APM_FULL_FRAMEWORK_CONFIGURATION_READER_TYPEElasticApm:FullFrameworkConfigurationReaderType
DefaultType
NoneString

If this setting is set in both the web.config file and as an environment variable, then the web.config file has precedence.


[8]ページ先頭

©2009-2025 Movatter.jp