.Net OpenTelemetry APM

Complete these tasks to properly integrate OpenTelemetry APM in .Net:

Install

Run these install commands to install .Net packages:

dotnet add package OpenTelemetry.Extensions.Hosting
dotnet add package OpenTelemetry.Instrumentation.AspNetCore
dotnet add package OpenTelemetry.Exporter.Console

Set Up Instrumentation

To set up the instrumentation and use the APIs for manual instrumentation, follow these steps from the see OpenTelemetry’s documentation of Manual Instrumentation Setup:

For creating spans using the OpenTelemetry JS API, use the following OpenTelemetry documentation: Initialize Tracing.

To use auto-instrumentation instead of manually creating spans for your functions, explore the Instrumentation Libraries.

Instrumentation Libraries

OpenTelemetry .Net can automatically instrument and support apps.

We recommend that you review the OpenTelemetry instruction on Using instrumentation libraries to automatically instrument standard .Net packages.

Also, review the available OpenTelemetry Registry for .Net and OpenTelemetry .NET on GitHub.

Examples

You can use a set of fully-functional, working examples of OpenTelemetry for .Net from OpenTelemetry .Net Examples. You can run them locally.