What problem does it solve?
Adding observability to .NET applications is error-prone: developers often add unnecessary OpenTelemetry NuGet packages to libraries, misuse ActivitySource and Meter APIs, create high-cardinality metrics, or record exceptions in ways that break backend compatibility. This Skill provides authoritative guidance for instrumenting .NET code correctly using the built-in System.Diagnostics APIs.
Core Features & Use Cases
- Tracing with Activities: Guides correct use of ActivitySource, ActivityKind selection, span naming, status/error handling, span links, and W3C context propagation across HTTP and messaging boundaries.
- Metrics with Meters: Covers all 7 .NET metric instrument types (Counter, Histogram, Gauge, observable variants), dimension cardinality management, naming conventions, and exemplars.
- SDK Setup & Logs: Explains application-root SDK configuration, resources, exporters (OTLP, Prometheus, Console), sampling strategies, and ILogger integration with trace correlation.
- Use Case: When adding distributed tracing to an ASP.NET Core order-processing service, the Skill ensures you use zero-dependency System.Diagnostics APIs in libraries, configure OTLP exporters only at the application root, and record exceptions in a way current .NET tooling can consume.
Quick Start
Ask the assistant to add OpenTelemetry tracing and metrics instrumentation to your .NET service following the built-in System.Diagnostics API patterns.