opentelemetry

opentelemetry is a skill for Claude Code from zdanovichnick/dotnet-pilot. It costs 30 tokens per session (1,774 once invoked), scanned A, original, MIT.

A reference for adding OpenTelemetry monitoring to .NET and ASP.NET Core services.

In plain words
What is it for?
It covers tracing, custom spans, metrics, .NET Aspire integration, and sending data through the OpenTelemetry Protocol.
Why use it?
It shows how to collect traces and measurements so activity across web requests, HTTP calls, databases, and runtime components can be observed.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the dotnet-pilot plugin — 16 skills, 15 agents, 3 hooks, 1 MCP server shipped together

Good fit It covers tracing, custom spans, metrics, .NET Aspire integration, and sending data through the OpenTelemetry Protocol.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zdanovichnick/dotnet-pilot/opentelemetry
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add zdanovichnick/dotnet-pilot --skill opentelemetry
Clone the repo
git clone --depth 1 https://github.com/zdanovichnick/dotnet-pilot

Made for: Claude Code.

Or install dotnet-pilot, the plugin that ships this one along with the rest of its 16 skills, 15 agents, 3 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for opentelemetry

README.md
[![agentmods](https://agentmods.dev/badge/skills/zdanovichnick/dotnet-pilot/opentelemetry.svg)](https://agentmods.dev/skills/zdanovichnick/dotnet-pilot/opentelemetry)
Your own site
<a href="https://agentmods.dev/skills/zdanovichnick/dotnet-pilot/opentelemetry"><img src="https://agentmods.dev/badge/skills/zdanovichnick/dotnet-pilot/opentelemetry.svg" alt="Measured on agentmods" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,774 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00030 $0.01774
Opus 5 $0.00015 $0.00887
Sonnet 5 $0.00006 $0.00355
Haiku 4.5 $0.00003 $0.00177

Measured 8d ago against content hash 4cd0f462907d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

opentelemetry scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/opentelemetry/SKILL.md · 224 lines

How it starts

The opening of the file, as written. The whole thing — 224 lines — stays where its author put it; the contents beside it link to each section on GitHub.

OpenTelemetry for .NET

Reference material for adding distributed tracing and metrics to ASP.NET Core services. Used by dnp-architect and dnp-tdd-developer-hard.

NuGet Packages

<!-- Core -->
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.*" />

<!-- Tracing instrumentation -->
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.*" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.*" />
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" Version="1.*" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.*" />

<!-- Exporter -->
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.*" />

Setup — Program.cs

builder.Services.AddOpenTelemetry()
    .WithTracing(tracing => tracing
        .AddAspNetCoreInstrumentation(options =>
        {
            options.RecordException = true;
            options.Filter = ctx => ctx.Request.Path != "/health"; // exclude health checks
        })
        .AddEntityFrameworkCoreInstrumentation(options =>
        {
            options.SetDbStatementForText = true; // include SQL in spans (dev only)
        })
        .AddHttpClientInstrumentation()
        .AddSource("MyApp.Orders")  // register custom ActivitySource names
        .AddOtlpExporter())
    .WithMetrics(metrics => metrics
        .AddAspNetCoreInstrumentation()
        .AddRuntimeInstrumentation()
        .AddMeter("MyApp.Orders")   // register custom Meter names
        .AddOtlpExporter());

SetDbStatementForText = true captures SQL — disable in production to avoid leaking query parameters containing PII.

Custom Spans (Activity)

ActivitySource is .NET's API for creating custom spans. One source per logical module.

// Register as singleton in DI:
builder.Services.AddSingleton(new ActivitySource("MyApp.Orders"));
// Usage in a handler or service:
public class ProcessOrderHandler(IOrderRepository orders, ActivitySource activitySource)
{
    public async Task<Order> HandleAsync(ProcessOrderCommand cmd, CancellationToken ct)
    {
        using var activity = activitySource.StartActivity("ProcessOrder");
        activity?.SetTag("order.id", cmd.OrderId.ToString());
        activity?.SetTag("order.customer_id", cmd.CustomerId.ToString());

        try
        {
            var order = await orders.GetByIdAsync(cmd.OrderId, ct)
                ?? throw new NotFoundException($"Order {cmd.OrderId} not found.");

            activity?.SetTag("order.status", order.Status.ToString());

            // business logic...

            return order;
        }
        catch (Exception ex)
        {
            activity?.SetStatus(ActivityStatusCode.Error, ex.Message);
            activity?.RecordException(ex);
            throw;
        }
    }
}

Read the full file on GitHub · 224 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 224 lines · 30 tokens per session scan A 4cd0f462907d

Subscribe to this mod's changes

opentelemetry is a skill published in the GitHub repository zdanovichnick/dotnet-pilot (4 stars, last pushed 11d ago), licensed MIT. It adds 30 tokens to every session and 1,774 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories