apm-agent-dotnet is a free, open source monitoring & observability project written in C# and released under Apache-2.0. It has 594 GitHub stars, 219 forks and 0 open issues, and was last pushed 24 hours ago. On this registry it ranks #258 of 270 tracked projects in Monitoring & Observability, with 5 head-to-head comparisons available.

What is apm-agent-dotnet?

apm-agent-dotnet is the official Elastic APM agent for .NET, a set of NuGet packages that adds distributed tracing, error monitoring and performance monitoring to .NET applications, and it is aimed at .NET developers and platform teams running ASP.NET Core, classic ASP.NET or .NET Standard 2.0 services.

What it is

The project is the .NET agent for Elastic APM. Its core project, Elastic.Apm, targets .NET Standard 2.0 and holds the Agent API, the infrastructure that reports data to the APM Server, the logging infrastructure, and auto-instrumentation for libraries that are part of .NET Standard 2.0. Every other project in the repository references that core, and each one targets a single library or framework, so instrumentation can be adopted one piece at a time. Sources live under src, and the published documentation is generated from the docs folder.

The concrete problem it solves is manual instrumentation. Instead of adding timing, tracing and error-capture calls to every web request and database query by hand, a team references the package that matches its stack and the agent instruments that framework or client automatically. For an ASP.NET Core service this means Elastic.Apm.AspNetCore for incoming requests, Elastic.Apm.EntityFrameworkCore for EF Core, and an integration such as Elastic.Apm.StackExchange.Redis or Elastic.Apm.MongoDb for downstream dependency calls.

Key capabilities

  • Auto-instrumentation for ASP.NET Core through the Elastic.Apm.AspNetCore package.
  • Auto-instrumentation for classic ASP.NET through Elastic.Apm.AspNetFullFramework, which ships as an IIS Module.
  • Single-package activation with Elastic.Apm.NetCoreAll, which references every .NET Core related Elastic APM package and activates all auto-instrumentation at once.
  • Entity Framework coverage in two packages: Elastic.Apm.EntityFrameworkCore for EF Core and Elastic.Apm.EntityFramework6 for Entity Framework 6.
  • Client integrations for Elastic.Apm.Elasticsearch, Elastic.Apm.StackExchange.Redis, Elastic.Apm.MongoDb, Elastic.Apm.Azure.ServiceBus, Elastic.Apm.Azure.Storage and Elastic.Apm.Azure.CosmosDb.
  • A public Agent API, documented in docs/public-api.asciidoc, for manual transactions and spans where automatic coverage does not reach.

Who uses it and how

  • ASP.NET Core teams that add Elastic.Apm.NetCoreAll to a service and receive request traces without editing application code.
  • Teams running classic ASP.NET on IIS that install Elastic.Apm.AspNetFullFramework and instrument through the IIS Module.
  • Services that call Redis, MongoDB, Elasticsearch, or Azure Service Bus, Cosmos DB and Storage, where the matching integration package turns each dependency call into a span.
  • Groups needing coverage the automatic instrumentation misses use the Agent API directly, and the project runs a public survey to prioritise which frameworks the agent supports next.

Getting started

Install from NuGet.org by referencing the package that matches the stack; adding Elastic.Apm.NetCoreAll turns the agent on and activates every .NET Core related auto-instrumentation. Full setup steps are in the Elastic documentation at https://www.elastic.co/guide/en/apm/agent/dotnet/current/index.html.

How it compares

No comparable tools are named in the facts available for this entry, so it stands alone in this registry rather than sitting beside a set of alternatives. Its distinguishing trait is the split between one core .NET Standard 2.0 project and a family of per-library packages that can be adopted individually or all at once.

When to use it — and when not to

A self-hoster must also run the Elastic APM Server that the agent reports to, because the agent is a client and produces no dashboards on its own. Teams that need a vendor-hosted product, or that run .NET stacks outside the frameworks listed above, should confirm current support before committing. The README excerpt is thin on configuration detail, and the project reserves GitHub tickets for confirmed bugs and enhancement requests, directing general help to the APM discuss forum, so the linked documentation is required reading.

project readme (upstream, from github) — read inline

apm-agent-dotnet

Build Status codecov

Please fill out this survey to help us prioritize framework support: https://goo.gl/forms/FHHbhptcDx8eDNx92

Installation

Official NuGet packages can be referenced from NuGet.org.

Package Name Purpose Download
Elastic.Apm The core of the Agent, Public Agent API, Auto instrumentation for libraries that are part of .NET Standard 2.0. NuGet Release
Elastic.Apm.AspNetCore ASP.NET Core auto instrumentation. NuGet Release
Elastic.Apm.EntityFrameworkCore Entity Framework Core auto instrumentation. NuGet Release
Elastic.Apm.NetCoreAll References every .NET Core related Elastic APM package. It can be used to simply turn on the agent and activate all auto instrumentation. NuGet Release
Elastic.Apm.AspNetFullFramework ASP.NET (classic) auto instrumentation with an IIS Module. NuGet Release
Elastic.Apm.EntityFramework6 Entity Framework 6 auto instrumentation. NuGet Release
Elastic.Apm.Elasticsearch Integration with the .NET clients for Elasticsearch. NuGet Release
Elastic.Apm.StackExchange.Redis Integration with the StackExchange.Redis client for Redis. NuGet Release
Elastic.Apm.MongoDb Integration with the MongoDb.Driver driver for MongoDb. NuGet Release
Elastic.Apm.Azure.ServiceBus Integration with Azure ServiceBus NuGet Release
Elastic.Apm.Azure.Storage Integration with Azure Storage NuGet Release
Elastic.Apm.Azure.CosmosDb Integration with Azure CosmosDB NuGet Release

Documentation

Docs are located here. That page is generated from the content of the docs folder.

Getting Help

If you have any feedback feel free to open an issue. For any other assistance, please open or add to a topic on the APM discuss forum.

If you need help or hit an issue, please start by opening a topic on our discuss forums. Please note that we reserve GitHub tickets for confirmed bugs and enhancement requests.

Contributing

See the contributing documentation

Releasing

See the releasing documentation

Repository structure

These are the main folders within the repository:

  • src: The source code of the agent. Each project within this folder targets a specific library, and there is one core project, which is referenced by all other projects.
    • Elastic.Apm: The core project targeting .NET Standard 2.0. It contains the Agent API, the infrastructure to report data to the APM Server, the logging infrastructure, and auto-instrumentation for things that are part of .NET Standard 2.0.
    • Elastic.Apm.AspNetCore: Auto-instrumentation for ASP.NET Core.
    • Elastic.Apm.EntityFrameworkCore: Auto-instrumentation for EntityFramework Core.
    • Elastic.Apm.NetCoreAll: A convenient project that references all other .NET Core related projects from the src folder. It contains an ASP.NET Core middleware extension that enables the agent and every other component with a single line of code. In a typical ASP.NET Core application (for example, apps referencing Microsoft.AspNetCore.All) that uses EF Core the Elastic.Apm.NetCoreAll can be referenced.
    • Elastic.Apm.AspNetFullFramework: Auto-instrumentation for ASP.NET (classic).
    • Elastic.Apm.EntityFramework6: Auto-instrumentation for Entity Framework 6.
    • Elastic.Apm.SqlClient: Auto-instrumentation for System.Data.SqlClient and Microsoft.Data.SqlClient.
    • Elastic.Apm.Elasticsearch: Auto-instrumentation for the official .NET clients for Elasticsearch.
    • Elastic.Apm.StackExchange.Redis: Auto-instrumentation for the StackExchange.Redis client for Redis.
    • Elastic.Apm.MongoDb: Instrumentation for the MongoDb.Driver driver for MongoDb.
    • Elastic.Apm.Azure.ServiceBus: Instrumentation for Azure ServiceBus.
    • Elastic.Apm.Azure.Storage: Instrumentation for Azure Storage.
  • test: This folder contains test projects. Typically each project from the src folder has a corresponding test project.
    • Elastic.Apm.Tests: Tests the Elastic.Apm project.
    • Elastic.Apm.AspNetCore.Tests: Tests the Elastic.Apm.AspNetCore project.
    • Elastic.Apm.AspNetFullFramework.Tests: Tests the Elastic.Apm.AspNetFullFramework project.
    • Elastic.Apm.Tests.MockApmServer: Implementation of APM Server mock used for agent-as-component tests (for example in Elastic.Apm.AspNetFullFramework.Tests).
  • docs: This folder contains the official documentation.
  • sample: Sample applications that are monitored by the APM .NET Agent. These are also very useful for development: you can start one of these applications and debug the agent through them.
  • .build: Contains files used when building the solution, and a project to perform common build tasks.
  • .ci: This folder contains all the scripts used to build, test and release the agent within the CI.

License

Elastic APM .NET Agent is licensed under Apache License, Version 2.0.

Frequently asked questions

Is apm-agent-dotnet free to use?

apm-agent-dotnet is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does apm-agent-dotnet do?

apm-agent-dotnet is an open source project.

What is apm-agent-dotnet written in?

apm-agent-dotnet is primarily written in C#. Its source is publicly available at https://github.com/elastic/apm-agent-dotnet, and it has 594 GitHub stars.