opentelemetry

Configures .NET 10 OpenTelemetry traces, metrics and logs with OTLP export.

1|Updated Apr 28, 2026
One-click install
npx skills add https://github.com/Trossitec/dotnet-claude-kit --skill opentelemetry-trossitec
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: opentelemetry
Source: https://github.com/Trossitec/dotnet-claude-kit/tree/main/skills/opentelemetry
Command: npx skills add https://github.com/Trossitec/dotnet-claude-kit --skill opentelemetry-trossitec

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps .NET developers instrument applications with OpenTelemetry so traces, metrics, and logs are consistent and export reliably to an OTLP backend.

Core Features & Use Cases

  • Unified observability setup: Configure traces, metrics, and logs with a single AddOpenTelemetry() approach and export with OTLP.
  • Correct metric creation: Use IMeterFactory to create meters safely under DI to avoid leaks and lifetime issues.
  • Production-friendly telemetry conventions: Set resources (service name/version), register custom ActivitySource and Meter instruments, use null-safe activities, and keep metric tag cardinality low.
  • Aspire Dashboard integration: Point OTLP export to Aspire Dashboard for fast local validation of telemetry.
  • Quick implementation patterns: Define counters/histograms/gauges and implement ActivitySource spans for custom business operations.

Quick Start

Tell the AI to generate a Program.cs OpenTelemetry setup for traces, metrics, and OTLP export using ActivitySource and IMeterFactory, including environment-variable configuration for OTEL_EXPORTER_OTLP_ENDPOINT and OTEL_SERVICE_NAME.

Frequently Asked Questions about opentelemetry

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

FAQPage Schema
How do I configure distributed tracing and metrics in a .NET 10 application?

You configure distributed tracing and metrics in .NET 10 by using AddOpenTelemetry() to enable traces and metrics with OTLP export, registering custom ActivitySource spans and IMeterFactory instruments.

What is the best way to export OpenTelemetry telemetry to Aspire Dashboard for local validation?

Export OpenTelemetry telemetry to Aspire Dashboard for local validation by configuring the OTLP export endpoint via the OTEL_EXPORTER_OTLP_ENDPOINT environment variable in your .NET application.

Why should I use IMeterFactory instead of directly creating meters for OpenTelemetry metrics?

Use IMeterFactory to create meters safely under dependency injection, avoiding memory leaks and lifetime issues when registering custom counters, histograms, and gauges for OpenTelemetry metrics.

How do I implement null-safe ActivitySource spans for custom business operations?

Implement null-safe ActivitySource spans by using null-safe StartActivity handling, ensuring custom distributed tracing spans for business operations do not throw exceptions when no listener is active.

How do I manage OpenTelemetry service names and resource settings using environment variables?

Manage OpenTelemetry service names and resource settings by using environment-driven OTEL_* variables like OTEL_SERVICE_NAME to apply consistent service attributes across all exported traces and metrics.

How do I keep metric tag cardinality low when registering custom OpenTelemetry instruments?

Keep metric tag cardinality low when registering custom OpenTelemetry instruments by avoiding high-cardinality values like user IDs in tags, preventing excessive time series generation and backend storage issues.