Native Monitoring in .NET
In this chapter, we’ll explore the out-of-the-box diagnostic capabilities of modern .NET applications, starting with logs and ad hoc diagnostics, and then move on to examine what OpenTelemetry provides on top of that. We’ll create a sample application and instrument it, showcasing cross-process log correlation, and learn how we can capture verbose logs with dotnet-monitor
. Then, we’ll investigate .NET runtime counters and export them to Prometheus. Finally, we’ll configure OpenTelemetry to collect traces and metrics from .NET, ASP.NET Core, and Entity Framework, and check out how basic auto-instrumentations address observability needs.
The following topics are what we’ll cover:
- Native log correlation in ASP.NET Core applications
- Minimalistic monitoring with .NET runtime counters
- Install OpenTelemetry and enable common instrumentations
- Tracing and performance analysis with HTTP and database instrumentations...