configuring-opentelemetry-dotnet
Configure OpenTelemetry distributed tracing, metrics, and logging in ASP.NET Core using the .NET OpenTelemetry SDK. Use when adding observability, setting up OTLP exporters, creating custom metrics/spans, or troubleshooting distributed trace correlation.
npx skills add dotnet/skills --skill configuring-opentelemetry-dotnet --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Configuring OpenTelemetry in .NET ## When to Use - Adding distributed tracing to an ASP.NET Core application - Setting up OpenTelemetry exporters (OTLP is the primary protocol; Jaeger accepts OTLP natively; Prometheus OTLP ingestion requires explicit opt-in) - Creating custom metrics or trace spans for business operations - Troubleshooting distributed trace context propagation across services ## When Not to Use - The user wants application-level logging only (use ILogger, Serilog) - The user is using Application Insights SDK directly (different API) - The user needs APM with a commercial vendor's proprietary SDK ## Inputs | Input | Required | Description | |-------|----------|-------------| | ASP.NET Core project | Yes | The application to instrument | | Observability backend | No | Where to export: OTLP collector, Aspire dashboard, Jaeger (accepts OTLP natively) | ## Workflow ### Step 1: Install the correct packages **There are many OpenTelemetry NuGet packages. Install exactly these:** ```bash # Core SDK + ASP.NET Core instrumentation + logging integration dotnet add package OpenTelemetry.Extensions.Hosting dotnet add package OpenTelemetry.Instrumentation.AspNetCore dotnet add
- When to Use
- When Not to Use
- Inputs
- Workflow
- Step 1: Install the correct packages
- Step 2: Configure all signals in Program.cs
- Step 3: Understanding log–trace correlation
- Step 4: Create custom spans (Activities) for business operations
- Step 5: Create custom metrics
- Step 6: Configure context propagation for distributed scenarios
- Validation
- Common Pitfalls
Core SDK + ASP.NET Core instrumentation + logging integration dotnet add package OpenTelemetry.Extensions.Hosting dotnet add package OpenTelemetry.Instrumentation.AspNetCore dotnet add package OpenTelemetry.Instrumentation.Http Exporter dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol # OTLP exporter for traces, metrics, AND logs Optional — dev/local debugging only (do NOT include in production deployments) dotnet add package OpenTelemetry.Exporter.Console dotnet add package OpenTelemetry.Instrumentation.SqlClient # SQL Server queries dotnet add package OpenTelemetry.Instrumentation.EntityFrameworkCore # EF Core
What does the configuring-opentelemetry-dotnet skill do?
Configure OpenTelemetry distributed tracing, metrics, and logging in ASP.NET Core using the .NET OpenTelemetry SDK. Use when adding observability, setting up OTLP exporters, creating custom metrics/spans, or troubleshooting distributed trace correlation.
How do I install it?
Run `npx skills add dotnet/skills --skill configuring-opentelemetry-dotnet --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From dotnet/skills, a repository with 4,927 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.