Set up the Agent

edit

The .NET Agent ships as a set of NuGet packages via nuget.org. You can add the Agent to your .NET application by referencing one of these packages.

On .NET Core the agent also supports auto instrumentation without any code change and without any recompilation of your projects. See section Zero code change setup on .NET Core for more details.

Get started

edit

Packages

edit

The following packages are available:

Elastic.Apm.NetCoreAll
This is a meta package that references every other Elastic APM .NET agent package. If you plan to monitor a typical ASP.NET Core application that depends on the Microsoft.AspNetCore.All package and uses Entity Framework Core then you should reference this package. In order to avoid adding unnecessary dependencies in applications that aren’t depending on the Microsoft.AspNetCore.All package we also offer some other packages - those are all referenced by the Elastic.Apm.NetCoreAll package.
Elastic.Apm
This is the core of the agent, which we didn’t name “Core”, because someone already took that name :) This package also contains the Public API and it is a .NET Standard 2.0 package. We also ship every tracing component that traces classes that are part of .NET Standard 2.0 in this package, which includes the monitoring part for HttpClient. Every other Elastic APM package references this package.
Elastic.Apm.Extensions.Hosting( [1.6.0-beta] Added in 1.6.0-beta. )
This package offers integration with Microsoft.Extensions.Hosting.IHostBuilder for agent registration.
Elastic.Apm.AspNetCore
This package contains ASP.NET Core monitoring related code. The main difference between this package and the Elastic.Apm.NetCoreAll package is that this package does not reference the Elastic.Apm.EntityFrameworkCore package, so if you have an ASP.NET Core application that does not use EF Core and you want to avoid adding additional unused references, you should use this package.
Elastic.Apm.EntityFrameworkCore
This package contains EF Core monitoring related code.
Elastic.Apm.AspNetFullFramework
This package contains ASP.NET (Full .NET Framework) monitoring related code.
Elastic.Apm.EntityFramework6
This package contains an interceptor that automatically creates spans for DB operations executed by Entity Framework 6 (EF6) on behalf of the application.
Elastic.Apm.SqlClient
This package contains System.Data.SqlClient and Microsoft.Data.SqlClient monitoring related code.