ASP.NETedit

Quick startedit

For ASP.NET (Full .NET Framework), once you’ve referenced the Elastic.Apm.AspNetFullFramework package, you can enable auto instrumentation by including the ElasticApmModule IIS Module in your application’s web.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.webServer>
        <modules>
            <add name="ElasticApmModule" type="Elastic.Apm.AspNetFullFramework.ElasticApmModule, Elastic.Apm.AspNetFullFramework" />
        </modules>
    </system.webServer>
</configuration>

By default the agent creates transactions for all HTTP requests, including the ones for static content: .html pages, images, etc. If you would like to create transactions only for HTTP requests with dynamic content, such as .aspx pages, you can add managedHandler preCondition (official documentation) as shown in the following example:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.webServer>
        <modules>
            <add name="ElasticApmModule" type="Elastic.Apm.AspNetFullFramework.ElasticApmModule, Elastic.Apm.AspNetFullFramework" preCondition="managedHandler" />
        </modules>
    </system.webServer>
</configuration>

You can also configure the agent using web.config as described at Configuration on ASP.NET.