# Diagnostics ## πŸ“• Articles - [DiagnosticSource User's Guide](https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.DiagnosticSource/src/DiagnosticSourceUsersGuide.md) - [Activity User Guide](https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.DiagnosticSource/src/ActivityUserGuide.md) - [EventSource User’s Guide](https://github.com/microsoft/dotnet-samples/blob/master/Microsoft.Diagnostics.Tracing/EventSource/docs/EventSource.md) - [Diagnostic Source in.Net Core](https://www.fatalerrors.org/a/diagnostic-source-in.net-core.html) - [Improve Activity API usability and OpenTelemetry integration](https://github.com/dotnet/designs/blob/main/accepted/2020/diagnostics/activity-improvements.md) - [Improve Activity API usability and OpenTelemetry integration (Part 2)](https://github.com/dotnet/designs/blob/main/accepted/2020/diagnostics/activity-improvements-2.md) - [The TraceEvent Library Programmers Guide](https://github.com/microsoft/dotnet-samples/blob/master/Microsoft.Diagnostics.Tracing/TraceEvent/docs/TraceEvent.md) - [What diagnostic tools are available in .NET Core?](https://docs.microsoft.com/en-us/dotnet/core/diagnostics/) - [.NET distributed tracing concepts](https://docs.microsoft.com/en-us/dotnet/core/diagnostics/distributed-tracing-concepts) - [Adding distributed tracing instrumentation](https://docs.microsoft.com/en-us/dotnet/core/diagnostics/distributed-tracing-instrumentation-walkthroughs) - [Collect a distributed trace](https://docs.microsoft.com/en-us/dotnet/core/diagnostics/distributed-tracing-collection-walkthroughs) - [Activity Class](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.activity) - [ActivityListener Class](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.activitylistener) - [ActivitySource Class](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.activitysource) - [ActivityLink Struct](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.activitylink) - [EventListener Class](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.tracing.eventlistener) - [EventSource Class](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.tracing.eventsource) - [Introducing diagnostics improvements in .NET Core 3.0](https://devblogs.microsoft.com/dotnet/introducing-diagnostics-improvements-in-net-core-3-0/) - [Diagnostics improvements in .NET 5](https://devblogs.microsoft.com/dotnet/diagnostics-improvements-in-net-5/) - [Logging using DiagnosticSource in ASP.NET Core](https://andrewlock.net/logging-using-diagnosticsource-in-asp-net-core/) - [Using the DiagnosticSource in .NET Core: Theory](https://sudonull.com/post/3671-Using-the-DiagnosticSource-in-NET-Core-Theory) - [Dumps](https://docs.microsoft.com/en-us/dotnet/core/diagnostics/dumps) - [EventCounters in .NET Core](https://docs.microsoft.com/en-us/dotnet/core/diagnostics/event-counters) - [.NET Core logging and tracing](https://docs.microsoft.com/en-us/dotnet/core/diagnostics/logging-tracing) - [.NET Diagnostics Tools: dump vs. gcdump](https://www.stefangeiger.ch/2020/04/21/dotnet-diagnostics-tools-gcdump-vs-dump.html) - [Diagnostics in .Net Core 3: Listening to outbound HTTP requests](https://im5tu.io/article/2020/06/diagnostics-in-.net-core-3-listening-to-outbound-http-requests/) - [.NET Tip: Performance Counters for MemoryCache](https://www.stefangeiger.ch/2019/11/25/dotnet-tip-memorycache-perfcounter.html) - [Investigate performance counters (dotnet-counters)](https://docs.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-counters) - [Use Performance Counters in .NET to measure Memory, CPU, and Everything – Full Guide](https://michaelscodingspot.com/performance-counters/) - [Reporting Metrics Using .Net (Core) EventSource and EventCounte](https://dev.to/expecho/reporting-metrics-using-net-core-eventsource-and-eventcounter-23dn) - [Creating a Custom ETW EventSource for Debugging High-Performance Code in C#](https://aaronstannard.com/creating-your-own-ETW-source/) - [Tracing with EventSource in .NET 4.5](http://dev.goshoom.net/2013/04/tracing-with-eventsource/) - [Exploring EventSource Activity (correlation and causation) Features](https://docs.microsoft.com/en-us/archive/blogs/vancem/exploring-eventsource-activity-correlation-and-causation-features) - [DiagnosticSource User's Guide](https://github.com/dotnet/runtime/blob/main/src/libraries/System.Diagnostics.DiagnosticSource/src/DiagnosticSourceUsersGuide.md) - [Output Diagnostic Source to Event Source](https://sourceexample.com/output-diagnostic-source-to-event-source-84888/) - [MassTransit DiagnosticSource](https://masstransit-project.com/advanced/monitoring/diagnostic-source.html) - [MassTransit Performance counters](https://masstransit-project.com/advanced/monitoring/perfcounters.html) - [Introducing Ukadc.Diagnostics](http://www.thejoyofcode.com/Introducing_Ukadc_Diagnostics.aspx) - [From zero to logging with System.Diagnostics in 15 minutes](http://www.thejoyofcode.com/From_zero_to_logging_with_System_Diagnostics_in_15_minutes.aspx) - [Cross-platform diagnostic tools for .NET Core](https://www.hanselman.com/blog/crossplatform-diagnostic-tools-for-net-core) - [Observing .NET Core Counters (in CloudWatch)](https://www.nocture.dk/2020/05/16/observing-.net-core-counters-in-cloudwatch/) - [A Lap Around ActivitySource and ActivityListener in .NET 5](https://jimmybogard.com/activitysource-and-listener-in-net-5/) - [Increasing Trace Cardinality with Activity Tags and Baggage](https://jimmybogard.com/increasing-trace-cardinality-with-tags-and-baggage/) - [Add SkyWalking + SkyApm-dotnet distributed link tracking system to the microservice framework Demo.MicroServer](https://www.programmersought.com/article/76773716203/) - [Using System.Diagnostic.DiagnosticSource to intercept database requests](https://bartwullems.blogspot.com/2021/01/using-systemdiagnosticdiagnosticsource.html) - [Diagnostic log Diagnosticsource in .NET CORE](https://www.programmersought.com/article/68718725762/) - [EventSource? DiagnosticSource? Both?](https://github.com/dotnet/aspnetcore/issues/2312) - [.NET Core 2.2: Runtime Events](https://jaliyaudagedara.blogspot.com/2019/01/net-core-22-runtime-events.html) - [ASP.NET Core Apps Observability](https://devblogs.microsoft.com/aspnet/observability-asp-net-core-apps/) - [OpenTelemetry .NET API](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry.Api/README.md) - [OpenTelemetry in .NET](https://lightstep.com/blog/opentelemetry-net-all-you-need-to-know/) - [Increasing Trace Cardinality with Activity Tags and Baggage](https://jimmybogard.com/increasing-trace-cardinality-with-tags-and-baggage/) - [Getting started with OpenTelemetry and distributed tracing in .NET Core](https://www.mytechramblings.com/posts/getting-started-with-opentelemetry-and-dotnet-core/) - [Monitoring background task](https://rafaelldi.blog/posts/monitoring-background-task/) - [Profiling a .NET6 app running in a linux container with dotnet-trace, dotnet-dump, dotnet-counters, dotnet-gcdump and Visual Studio](https://www.mytechramblings.com/posts/profiling-a-net-app-with-dotnet-cli-diagnostic-tools/) - [A brief introduction to DiagnosticSource](https://andrewlock.net/a-brief-introduction-to-diagnostic-source/) - [Consuming anonymous types with DiagnosticListener in .NET 6](https://andrewlock.net/consuming-anonymous-types-with-diagnosticlistener-in-dotnet6/) ## πŸ“Ί Videos - [Diagnostics Improvements in .NET Core 3.0](https://www.youtube.com/watch?v=fkjetdIdcyg) - [Introducing the Diagnostics Client Library for .NET Core](https://www.youtube.com/watch?v=Rei6d9nKaFQ) - [Cool things you can do with .NET Core 3 Tooling - Jonathan Mezach](https://www.youtube.com/watch?v=MSCRzPiGKr8) - [DiagnosticSource and Activity, Tracing in .NET Part 1 - .NET Concept of the Week - Episode 18](https://www.youtube.com/watch?v=y52l8XR3XK4) - [.NET Design Review: System.Diagnostics.Activity](https://www.youtube.com/watch?v=a3xPdYi6jYU) - [Diagnosing .NET 6 issues from sidecar containers using dotnet-monitor](https://www.youtube.com/watch?v=oCY9BsAw5oU) - [.NET Diagnostics for Applications: Best Practices](https://www.pluralsight.com/courses/dot-net-diagnostics-applications-best-practices) - [dotnet-monitor Fundamentals - Accessing .NET Diagnostics Easier](https://www.youtube.com/watch?v=pG0t19bEYJw) - [dotnet-monitor: Enabling a diagnostics sidecar in AKS](https://www.youtube.com/watch?v=3nzZO34nUFQ) ## πŸš€ Samples - [gregkalapos/DiagnosticSource](https://github.com/gregkalapos/DotNetConceptOfTheWeek/tree/master/18_DiagnosticSource) - [aspnet/AspNetCore/blob/master/src/Hosting/Hosting/src/Internal/HostingEventSource.cs](https://github.com/aspnet/AspNetCore/blob/master/src/Hosting/Hosting/src/Internal/HostingEventSource.cs) - [aspnet/AspNetCore/blob/master/src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelEventSource.cs](https://github.com/aspnet/AspNetCore/blob/master/src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelEventSource.cs) - [SkyAPM-dotnet/SkyApm.Diagnostics.AspNetCore/HostingDiagnosticProcessor](https://github.com/SkyAPM/SkyAPM-dotnet/blob/master/src/SkyApm.Diagnostics.AspNetCore/HostingDiagnosticProcessor.cs) - [dotnet/runtime/DiagnosticsHandler](https://github.com/dotnet/runtime/blob/4f9ae42d861fcb4be2fcd5d3d55d5f227d30e723/src/libraries/System.Net.Http/src/System/Net/Http/DiagnosticsHandler.cs#L98) - [dotnet/aspnetcore/HostingApplicationDiagnostics](https://github.com/dotnet/aspnetcore/blob/master/src/Hosting/Hosting/src/Internal/HostingApplicationDiagnostics.cs#L314) - [open-telemetry/opentelemetry-dotnet/OpenTelemetry.Instrumentation.StackExchangeRedis](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry.Instrumentation.StackExchangeRedis/README.md) - [open-telemetry/opentelemetry-dotnet/OpenTelemetry.Instrumentation.SqlClient](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.SqlClient) - [open-telemetry/opentelemetry-dotnet/OpenTelemetry.Instrumentation.AspNetCore](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.AspNetCore) - [open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.Http](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.Http) - [open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.GrpcNetClient](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.GrpcNetClient) - [jbogard/MongoDB.Driver.Core.Extensions.OpenTelemetry](https://github.com/jbogard/MongoDB.Driver.Core.Extensions.OpenTelemetry) - [jbogard/MongoDB.Driver.Core.Extensions.DiagnosticSources](https://github.com/jbogard/MongoDB.Driver.Core.Extensions.DiagnosticSources) - [open-telemetry/opentelemetry-dotnet/examples](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/examples) ## πŸ“¦ Libraries - [open-telemetry/opentelemetry-dotnet](https://github.com/open-telemetry/opentelemetry-dotnet) - The OpenTelemetry .NET Client - [Azure/diagnostics-eventflow](https://github.com/Azure/diagnostics-eventflow) - Microsoft Diagnostics EventFlow - [bluekiri/bluekiri-diagnostics-prometheus](https://github.com/bluekiri/bluekiri-diagnostics-prometheus) - Exposes Diagnostic Source events as prometheus metrics using prometheus-net underneath - [sgryphon/essential-diagnostics](https://github.com/sgryphon/essential-diagnostics) - Essential.Diagnostics contains additional trace listeners, filters and utility classes for the .NET Framework System.Diagnostics trace logging. Included are colored console, SQL database, rolling file, Seq logging server, and in-memory trace listeners, expression filters, activity and logical operation scopes, and configuration file monitoring. - [SkyAPM/SkyAPM-dotnet](https://github.com/SkyAPM/SkyAPM-dotnet) - [open-telemetry/opentelemetry-dotnet/OpenTelemetry.Instrumentation.StackExchangeRedis](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/src/OpenTelemetry.Instrumentation.StackExchangeRedis/README.md) - [open-telemetry/opentelemetry-dotnet/OpenTelemetry.Instrumentation.SqlClient](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.SqlClient) - [open-telemetry/opentelemetry-dotnet/OpenTelemetry.Instrumentation.AspNetCore](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.AspNetCore) - [open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.Http](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.Http) - [open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.GrpcNetClient](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Instrumentation.GrpcNetClient) - [jbogard/MongoDB.Driver.Core.Extensions.OpenTelemetry](https://github.com/jbogard/MongoDB.Driver.Core.Extensions.OpenTelemetry) - [jbogard/MongoDB.Driver.Core.Extensions.DiagnosticSources](https://github.com/jbogard/MongoDB.Driver.Core.Extensions.DiagnosticSources) - extends the core MongoDB C# driver to expose telemetry information via System.Diagnostics. - [spectreconsole/errata](https://github.com/spectreconsole/errata) - A library that makes it easy to create and display diagnostics of different kinds. - [alexvaluyskiy/prometheus-net-contrib](https://github.com/alexvaluyskiy/prometheus-net-contrib) - Exposes .NET core diagnostic listeners and counters