OpenTelemetry for .NET
OpenTelemetry for .NET supports a wide range of automatic and manual instrumentation options, helping you capture spans, metrics, and logs with minimal effort.Installation
Add the necessary OpenTelemetry packages to your project using NuGet:👉 OpenTelemetry .NET Getting Started
Auto-Instrumentation
Auto-instrumentation lets you automatically trace common libraries such as HTTP clients, database drivers, and more without needing to modify your code. OpenTelemetry provides auto-instrumentation libraries for many popular languages, making it fast to get started with tracing. For .NET, you can automatically instrument supported libraries like ASP.NET Core, HTTP clients, and more. Typically, you configure it in yourProgram.cs
:
👉 Auto-Instrumentation for .NET
Manual Instrumentation
Manual instrumentation gives you full control over your traces, allowing you to create spans wherever needed. You can customize span names, attributes, and relationships to capture the most important parts of your application’s flow. You can manually create and manage spans in .NET using the OpenTelemetry APIs:👉 Manual Instrumentation in .NET