otel-dotnet — Claude Code skill: OpenTelemetry for .NET
A skill for OpenTelemetry in .NET and ASP.NET Core: SDK setup through DI, instrumentation, the zero-code agent, and breaking-change audits.
npx skills add ollygarden/opentelemetry-agent-skills --skill otel-dotnet -a claude-codeWhat otel-dotnet does
This skill handles telemetry questions in C# services. It ships five references, and the agent loads the one that fits the task: SDK setup through the DI/builder path (AddOpenTelemetry, UseOtlpExporter, OpenTelemetrySdk.Create, OpenTelemetry.Extensions.Hosting), native APIs (ActivitySource, System.Diagnostics.Metrics.Meter, ILogger), the opentelemetry-dotnet-instrumentation CLR-profiler agent plus contrib packages, performance tuning, and a sweep for deprecated or renamed APIs.
Each reference stands on its own, so there is no need to read them all. For current versions the skill pulls from live sources: opentelemetry-dotnet releases through gh api, NuGet package pages, per-package CHANGELOG files at the core and contrib tags, and the opentelemetry.io docs. .NET has no released declarative YAML config yet — the skill points to the language-agnostic otel-declarative-config for schema details, and you will not find a working .NET implementation there.
Cross-references lead to the otel-sdk-versions and otel-semantic-conventions skills, since SDK version choice and semantic conventions live in their own places. Handy when traces already flow and you want metrics or logs added without rewriting the service.
What it helps with
- wire OpenTelemetry into an ASP.NET Core service through DI
- configure OTLP export for traces and metrics
- instrument code with
ActivitySourceandMeter - turn on the zero-code agent without touching source
- spot renamed APIs after a package upgrade
Example prompts for the agent
- Set up OpenTelemetry in my ASP.NET Core service with
AddOpenTelemetry - Add metrics through
System.Diagnostics.Metrics.Meterand export them over OTLP - Audit my code for deprecated OpenTelemetry APIs after the upgrade
How to install otel-dotnet
1Skills CLI (Vercel)
npx skills add ollygarden/opentelemetry-agent-skills --skill otel-dotnet -a claude-code2Manually: put the files in place
~/.claude/skills/otel-dotnet/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/otel-dotnet/
1Skills CLI (Vercel)
npx skills add ollygarden/opentelemetry-agent-skills --skill otel-dotnet -a codex2Manually: put the files in place
.agents/skills/otel-dotnet/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add ollygarden/opentelemetry-agent-skills --skill otel-dotnet -a cursor2Manually: put the files in place
.cursor/skills/otel-dotnet/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install ollygarden/opentelemetry-agent-skills otel-dotnet2Manually: put the files in place
.github/skills/otel-dotnet/SKILL.md1Skills CLI (Vercel)
npx skills add ollygarden/opentelemetry-agent-skills --skill otel-dotnet -a gemini-cli2Platform CLI
gemini skills install https://github.com/ollygarden/opentelemetry-agent-skills --path skills/otel-dotnetManually: put the files in place
.devin/skills/otel-dotnet/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add ollygarden/opentelemetry-agent-skills --skill otel-dotnet -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about otel-dotnet
How do I install otel-dotnet in Claude Code?
Run npx skills add ollygarden/opentelemetry-agent-skills --skill otel-dotnet -a claude-code, then check ~/.claude/skills/otel-dotnet/SKILL.md.
What does otel-dotnet do?
It gives the agent references on OpenTelemetry in .NET: SDK setup, native instrumentation APIs, the zero-code agent, performance tuning, and breaking-change audits.
Does .NET have declarative YAML config for OpenTelemetry?
No, .NET has no released implementation of it. The skill covers the DI/builder path and refers to the language-agnostic otel-declarative-config skill for YAML schema details only.
Source text
SKILL.md · Apache-2.0
--- name: otel-dotnet description: OpenTelemetry in .NET — DI/builder SDK setup (OpenTelemetry.Extensions.Hosting, AddOpenTelemetry, UseOtlpExporter, OpenTelemetrySdk.Create), native .NET instrumentation APIs (ActivitySource, System.Diagnostics.Metrics Meter) plus logging abstractions (ILogger), zero-code CLR-profiler agent, contrib instrumentation packages, performance tuning, and breaking-change audits. Use when adding, reviewing, or configuring OpenTelemetry in a .NET or ASP.NET Core service. Triggers on "setup otel in dotnet", "dotnet telemetry", ".net tracing", "ASP.NET Core opentelemetry", "AddOpenTelemetry", "UseOtlpExporter", "OpenTelemetrySdk.Create", "ActivitySource", "System.Diagnostics.Metrics Meter", "ILogger opentelemetry", "OpenTelemetry.Extensions.Hosting", "opentelemetry-dotnet-instrumentation", or any C# OTel question. --- # OpenTelemetry in .NET Entry point for OpenTelemetry mechanics in .NET services. Load a reference below based on the task; each reference is self-contained. ## References | File | Use when | |---|---| | [`references/setup.md`](references/setup.md) | Setting up the SDK via the DI/builder path (`AddOpenTelemetry().WithTracing/WithMetrics/WithLogging`, `UseOtlpExporter`, `OpenTelemetrySdk.Create`, `OpenTelemetry.Extensions.Hosting`), exporter wiring, env-var / `IConfiguration` inputs, and why there is no released declarative YAML config in .NET. | | [`references/api.md`](references/api.md) | Instrumenting with native BCL APIs (`ActivitySource`/`Activity`, `System.Diagnostics.Metrics.Meter`, `ILogger`), how the SDK subscribes (`AddSource`/`AddMeter`), attributes, propagation, and the optional OTel API shim. | | [`references/instrumentation-libraries.md`](references/instrumentation-libraries.md) | Zero-code (the `opentelemetry-dotnet-instrumentation` CLR-profiler agent), the contrib instrumentation-package catalog, and manual instrumentation following semconv. | | [`references/performance.md`](references/performance.md) | Tuning sampling (built-in samplers incl. `AlwaysRecordSampler`), batch export processor, periodic metric reader, views, exporter choice, async context, graceful shutdown. | | [`references/breaking-changes.md`](references/breaking-changes.md) | Auditing existing code for deprecated/renamed APIs and semconv changes across recent core/contrib releases. | ## Sources of Truth For YAML schema details (language-agnostic), see the `otel-declarative-config` skill — but note .NET does not yet have a released declarative-config implementation (see `references/setup.md`). For .NET-specific facts: | Fact | Fetch | |---|---| | Latest `OpenTelemetry` core / `core-*` tag | `gh api repos/open-telemetry/opentelemetry-dotnet/releases/latest -q '.tag_name'` | | Latest NuGet package (`OpenTelemetry`, `OpenTelemetry.Extensions.Hosting`, exporters, `OpenTelemetry.Instrumentation.<pkg>`) | `WebFetch https://www.nuget.org/packages/<PackageId>` (Version) | | Latest auto-instrumentation agent | `gh api repos/open-telemetry/opentelemetry-dotnet-instrumentation/releases/latest -q '.tag_name'` | | Core CHANGELOG (per package, at the release being audited) | `WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-dotnet/<core-tag>/src/<Package>/CHANGELOG.md` | | Contrib CHANGELOG (per package, at that package's release tag) | `WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-dotnet-contrib/<package-tag>/src/<Package>/CHANGELOG.md` | | .NET getting-started / instrumentation docs | `WebFetch https://opentelemetry.io/docs/languages/dotnet/instrumentation/` | | Zero-code agent docs | `WebFetch https://opentelemetry.io/docs/zero-code/dotnet/` | ## Cross-References - Schema-level facts: `otel-declarative-config` skill (language-agnostic YAML schema sources; .NET not yet implemented). - SDK version selection across languages: `otel-sdk-versions` skill. - Semantic conventions lookup: `otel-semantic-conventions` skill.
© ollygarden · Apache-2.0 · ollygarden/opentelemetry-agent-skills