opentelemetry

Configure OpenTelemetry SDK tracing and metrics for ASP.NET Core services.

4|Updated Apr 20, 2026
One-click install
npx skills add https://github.com/zdanovichnick/dotnet-pilot --skill opentelemetry-zdanovichnick
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: opentelemetry
Source: https://github.com/zdanovichnick/dotnet-pilot/tree/main/skills/opentelemetry
Command: npx skills add https://github.com/zdanovichnick/dotnet-pilot --skill opentelemetry-zdanovichnick

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Instrumenting ASP.NET Core services for distributed tracing and metrics is error-prone and inconsistent, leading to poor observability when debugging performance and reliability issues.

Core Features & Use Cases

  • Tracing with custom spans: Create Activities with consistent tags for key business events like order processing, while avoiding PII.
  • Metrics with meters: Record counters, histograms, and gauges for operational KPIs such as request rates, processing time, and pending workloads.
  • .NET Aspire integration: Avoid duplicate configuration by using AddServiceDefaults for OTEL wiring, while still registering your custom ActivitySource and Meter names.

Quick Start

Configure your ASP.NET Core app to register OpenTelemetry tracing and metrics with an OTLP exporter via environment variables, and add your custom ActivitySource and Meter names in the service startup.

Frequently Asked Questions about opentelemetry

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up distributed tracing in an ASP.NET Core service?

OpenTelemetry custom spans in .NET are created using an ActivitySource, where you record business events like order processing with consistent tags while ensuring no PII is included in the span attributes.

How do I record custom metrics in .NET using OpenTelemetry?

Custom metrics in .NET are recorded by configuring a custom Meter to track operational KPIs like request rates and processing times, then registering the Meter names in your service startup to export via the OTLP exporter.

Does this OpenTelemetry setup work with .NET Aspire deployments?

Yes, .NET Aspire integration uses AddServiceDefaults to handle OpenTelemetry wiring, preventing duplicate configuration while still allowing you to register custom ActivitySource and Meter names for export.

How do I export traces and metrics to an OTLP collector from a .NET app?

Exporting traces and metrics to an OTLP collector from a .NET app involves adding the OTLP exporter package and configuring the exporter endpoint and protocol settings, typically through standard environment variables.

What is the best way to avoid PII when instrumenting custom spans in .NET?

To avoid PII when instrumenting custom spans in .NET, apply consistent tag conventions by recording business event states and operational outcomes rather than raw user data as ActivitySource attributes.