Skills

Opentelemetry Net Instrumentation

Provides guidance for implementing OpenTelemetry instrumentation in .NET codebases...

Install

npx skills add Aaronontheweb/dotnet-skills --skill opentelemetry-net-instrumentation -g -a claude-code -y
Category
Design
Updated
7d ago
License
MIT
Context cost
Mediumabout 3,000 tokens
Runs scripts
No, instructions only

What it does

Provides guidance for implementing OpenTelemetry instrumentation in .NET codebases, covering tracing (Activities/Spans), metrics, logs, naming conventions, error handling, performance, SDK setup, resources, context propagation, and API design best practices.

OpenTelemetry .NET Instrumentation Skill

When to Use

  • Adding OpenTelemetry instrumentation to .NET code (traces, metrics, logs)
  • Creating or modifying ActivitySources, Meters, or ILogger usage
  • Setting up the OpenTelemetry SDK, resources, exporters, or sampling
  • Reviewing telemetry implementations for spec compliance
  • Optimizing instrumentation performance
  • Designing telemetry APIs that become part of the public surface
  • Implementing context propagation across service boundaries

Architecture: .NET Is Different

CRITICAL: The .NET OpenTelemetry implementation is fundamentally different from other platforms. .NET provides tracing, metrics, and logging APIs in the framework itself. That means OTel does not provide a separate instrumentation API, it uses the built-in .NET APIs and acts as the collection/export layer.

The Three Built-in .NET APIs (Primary, Zero Dependencies)

Signal.NET Framework APINamespace
TracingActivitySource / ActivitySystem.Diagnostics
MetricsMeter / Counter<T> / Histogram<T> / etc.System.Diagnostics.Metrics
LoggingILogger<T>Microsoft.Extensions.Logging

These are the primary and only APIs library authors should use for instrumentation. They ship with the .NET runtime, no NuGet packages required.

The OTel Collection/Export Layer (Secondary, Application Root Only)

OTel NuGet packages are the collection and export layer, added only at the application composition root (not in libraries):

Read the whole SKILL.md on GitHub

More in Design