Adds or fixes OpenTelemetry observability (traces, metrics, logs) across .NET, Node.js, Python, Java/Kotlin, and Go services. Generates production-shaped configuration with exporters for Jaeger, Tempo, Prometheus, OTLP, Azure Monitor, and more.
Ships in AI for Developers Toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Wire up OpenTelemetry in a service - traces, metrics, and logs - exported to the backend the user wants, with sensible production defaults. The concepts (resource, providers, instrumentation, exporters, propagation, sampling) are identical across SDKs; only the wiring differs.
Don't ask the user to paste startup code - point this at the project and inspect what's already there:
git clone --depth 1 <url> /tmp/repo && cd /tmp/repoIf OTel is already partly set up (e.g. metrics but no tracing), extend it rather than starting over, and call out the specific gap.
| Manifest | Stack | Look for existing wiring | Default approach |
|---|---|---|---|
*.csproj | .NET / ASP.NET Core | AddOpenTelemetry, WithTracing, AddOtlpExporter, OpenTelemetry.* packages | SDK in Program.cs (below) |
package.json | Node.js / TypeScript | @opentelemetry/sdk-node, instrumentation.ts, --require/--import flags | NodeSDK + auto-instrumentations |
pyproject.toml, requirements*.txt | Python | opentelemetry-distro, opentelemetry-instrument, TracerProvider | zero-code opentelemetry-instrument |
pom.xml, build.gradle(.kts) | Java / Kotlin | opentelemetry-javaagent, opentelemetry-spring-boot-starter, micrometer-tracing | Java agent (-javaagent) |
go.mod | Go | go.opentelemetry.io/otel, otelhttp, otelgrpc | manual SDK + contrib instrumentation |
grep -rn "AddOpenTelemetry\|WithTracing\|AddOtlpExporter" --include=*.cs <target> | grep -v "/obj/\|/bin/"
grep -rn "@opentelemetry/" <target>/package.json <target>/src 2>/dev/null
grep -rni "opentelemetry" <target>/pyproject.toml <target>/requirements*.txt 2>/dev/null
grep -rn "opentelemetry\|micrometer-tracing" <target>/pom.xml <target>/build.gradle* 2>/dev/null
grep -rn "go.opentelemetry.io" <target>/go.mod
Then establish (ask only what you can't infer):
service.name, service.version, deployment.environment) - non-negotiable.OTEL_SERVICE_NAME=orders-api
OTEL_RESOURCE_ATTRIBUTES=service.version=1.4.2,deployment.environment=production
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 # gRPC; http/protobuf uses :4318
OTEL_EXPORTER_OTLP_PROTOCOL=grpc # or http/protobuf
OTEL_TRACES_SAMPLER=parentbased_traceidratio
OTEL_TRACES_SAMPLER_ARG=0.1
Prefer env vars over hardcoded endpoints - same build runs against local Jaeger and production. Defaults differ per SDK (some default to http/protobuf on 4318), so set protocol and port explicitly.
dotnet add package OpenTelemetry.Extensions.Hosting
dotnet add package OpenTelemetry.Instrumentation.AspNetCore
dotnet add package OpenTelemetry.Instrumentation.Http
dotnet add package OpenTelemetry.Instrumentation.Runtime
dotnet add package OpenTelemetry.Exporter.OpenTelemetryProtocol
Add as needed: OpenTelemetry.Instrumentation.EntityFrameworkCore, OpenTelemetry.Exporter.Prometheus.AspNetCore, Azure.Monitor.OpenTelemetry.AspNetCore.
var builder = WebApplication.CreateBuilder(args);
const string serviceName = "my-service";
const string serviceVersion = "1.0.0";
builder.Services.AddOpenTelemetry()
.ConfigureResource(r => r
.AddService(serviceName, serviceVersion: serviceVersion)
.AddAttributes(new[] {
new KeyValuePair<string, object>("deployment.environment", builder.Environment.EnvironmentName)
}))
.WithTracing(tracing => tracing
.AddAspNetCoreInstrumentation(o => o.RecordException = true)
.AddHttpClientInstrumentation()
.AddEntityFrameworkCoreInstrumentation(o => o.SetDbStatementForText = true)
.AddSource(serviceName) // your custom ActivitySource
.SetSampler(new ParentBasedSampler(new TraceIdRatioBasedSampler(1.0))) // tune ratio in prod
.AddOtlpExporter())
.WithMetrics(metrics => metrics
.AddAspNetCoreInstrumentation()
.AddHttpClientInstrumentation()
.AddRuntimeInstrumentation()
.AddMeter(serviceName) // your custom Meter
.AddOtlpExporter());
builder.Logging.AddOpenTelemetry(logging =>
{
logging.IncludeScopes = true;
logging.IncludeFormattedMessage = true;
logging.AddOtlpExporter();
});
Custom span and metric:
private static readonly ActivitySource Activity = new("my-service");
public async Task PlaceOrderAsync(Order order, CancellationToken ct)
{
using var span = Activity.StartActivity("PlaceOrder");
span?.SetTag("order.id", order.Id);
try { await _repo.SaveAsync(order, ct); }
catch (Exception ex) { span?.SetStatus(ActivityStatusCode.Error, ex.Message); throw; }
}
public class OrderMetrics(IMeterFactory meterFactory)
{
private readonly Counter<long> _placed =
meterFactory.Create("my-service").CreateCounter<long>("orders.placed", unit: "{orders}");
public void OrderPlaced(string region) => _placed.Add(1, new KeyValuePair<string, object?>("region", region));
}
.NET backend variants:
OpenTelemetry.Exporter.Prometheus.AspNetCore, use .AddPrometheusExporter() for metrics, and app.MapPrometheusScrapingEndpoint();.builder.Services.AddOpenTelemetry().UseAzureMonitor(); (replaces exporters; set APPLICATIONINSIGHTS_CONNECTION_STRING).ActivitySource/Meter is invisible until registered with AddSource/AddMeter.references/otel-per-stack.md)| Stack | Setup | Instrumentation | Custom span | Custom metric |
|---|---|---|---|---|
| Node / TS | @opentelemetry/sdk-node NodeSDK in instrumentation.ts, loaded before the app (node --import/--require) | @opentelemetry/auto-instrumentations-node (http, express, fastify, pg, mysql, redis, ...) | trace.getTracer('svc').startActiveSpan(...) | metrics.getMeter('svc').createCounter(...) |
| Python | pip install opentelemetry-distro opentelemetry-exporter-otlp, opentelemetry-bootstrap -a install, run via opentelemetry-instrument <cmd> | auto (FastAPI, Django, Flask, requests, httpx, SQLAlchemy, psycopg, ...) | with tracer.start_as_current_span(...) | meter.create_counter(...) |
| Java / Kotlin | java -javaagent:opentelemetry-javaagent.jar -jar app.jar; or the OpenTelemetry Spring Boot starter (native image, no agent) | agent covers Spring MVC/WebFlux, JDBC, Hibernate, Kafka, gRPC, HTTP clients | @WithSpan or tracer.spanBuilder(...) | meter.counterBuilder(...) |
| Go | manual: go.opentelemetry.io/otel + SDK + OTLP exporter; set provider and propagator in main | contrib: otelhttp, otelgrpc, otelsql/driver wrappers | otel.Tracer("svc").Start(ctx, ...) | otel.Meter("svc").Int64Counter(...) |
Stack gotchas:
express/http are imported, or auto-instrumentation silently misses them. ESM apps need the --import hook path.opentelemetry-instrument doesn't work with reload mode; for pre-fork servers (gunicorn, uWSGI) initialize the SDK per worker (post-fork hook), not in the master.ctx passed through and wrapped handlers/transports; a missing ctx is a broken trace. Call tp.Shutdown(ctx) on exit or buffered spans are lost.references/otel-collector-compose.md.OTEL_EXPORTER_OTLP_ENDPOINT at them or at the collector.prometheus exporter, or the SDK's Prometheus exporter/scrape endpoint in-process.OTEL_EXPORTER_OTLP_HEADERS. Never commit the key.service.name, service.version, deployment.environment. Without them telemetry is unusable across services.traceparent over HTTP/gRPC is automatic with instrumented clients; for queues, inject/extract context manually (see distributed-tracing-diagnostics).## What I'm setting up
<stack detected, app type, backend, signals>
## Dependencies
<dotnet add package / npm i / pip install / Maven-Gradle coordinates or agent jar / go get>
## Wiring
<startup code for the detected stack>
## Custom instrumentation example
<span + metric relevant to their domain>
## Run it
<env vars / compose / how to see the data>
Pairs with structured-logging-setup (log/trace correlation), distributed-tracing-diagnostics, and metrics-dashboard-generator.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
OpenTelemetry, Prometheus, .NET, Node, Python, Java, Go, Spring Boot
/ai-dev-toolkit:opentelemetry-setupfrom AI for Developers Toolkit
npx claudepluginhub stefanthecode/ai-for-developers --plugin ai-dev-toolkit45 skills in this plugin
/api-endpoint-scaffolderScaffold HTTP API endpoints in any stack - ASP.NET Core Minimal APIs or controllers, Express, Fastify, NestJS, FastAPI, Django REST Framework, Spring Boot controllers, Go net/http, chi, Gin - one feature per endpoint (REPR style) with request validation, typed responses, route grouping, auth, and OpenAPI metadata. Use this skill whenever the user wants to add an endpoint or route, convert controllers to minimal APIs, structure routes or routers, set up endpoint groups, TypedResults, route handlers, request DTOs/schemas (zod, Pydantic, Bean Validation, binding tags), or asks "how do I add an endpoint / structure my API routes". Always use this skill for endpoint scaffolding; it generates a complete, validated endpoint that matches the project's conventions./architecture-test-generatorGenerate architecture tests / fitness functions that fail the build when architectural rules are violated - layer dependencies, module boundaries, cycles, naming, and visibility conventions - in any stack: NetArchTest or ArchUnitNET (.NET), ArchUnit or Konsist (Java/Kotlin), dependency-cruiser or eslint-plugin-boundaries (TypeScript/JavaScript), import-linter (Python), go-arch-lint or depguard (Go). Use this skill whenever the user wants architecture tests, to enforce layering or the dependency rule, dependency rules as tests, import rules, forbidden imports, no circular dependencies, naming conventions, fitness functions, or asks "how do I stop people breaking the architecture / enforce my layers / keep modules from importing each other". Always use this skill for architecture-test requests; it generates rules matching the project's real structure./async-await-auditorAudit async and concurrent code in any language for correctness and performance bugs - C#/.NET (async/await, Task), JavaScript/TypeScript (Promises, async/await), Python (asyncio), Java/Kotlin (CompletableFuture, virtual threads, coroutines), Go (goroutines, channels, context), Rust (tokio/async). Use this skill whenever the user shares async or concurrent code, or asks about deadlocks, hangs, blocking calls, .Result/.Wait(), async void, ConfigureAwait, floating or unhandled promises, await in a loop vs Promise.all, blocking the event loop, forgotten await, asyncio.gather/TaskGroup, CompletableFuture.join, virtual thread pinning, goroutine leaks, context cancellation, WaitGroup/errgroup, holding a lock across .await, fire-and-forget tasks, cancellation tokens, or "why does my async code hang". Always use this skill for async/concurrency reviews instead of answering from memory; it applies a fixed checklist and rewrites the code./authorization-setupDesign API authorization in any stack - policy-based, role-based, claims/permission-based, and resource-based (ownership) checks. Covers ASP.NET Core policies and AuthorizationHandler, NestJS guards, Express middleware and CASL, FastAPI dependencies/scopes, Django and DRF permission classes, Spring Security (@PreAuthorize, SecurityFilterChain), Go middleware, and Casbin/OPA. Use this skill whenever the user wants authorization policies, role/claim/permission checks, RBAC/ABAC, custom authorization rules, resource-based authorization, IDOR protection, "deny by default", or asks "how do I authorize this / policy vs role / restrict this endpoint to X / stop users seeing other users' data". Always use this skill for authorization requests; it generates policies, handlers, and endpoint wiring./benchmark-setupSet up correct micro-benchmarks in any stack and interpret the results - BenchmarkDotNet (.NET), JMH (Java/Kotlin), pytest-benchmark / pyperf (Python), Vitest bench / tinybench / mitata (JavaScript/TypeScript), Go testing.B + benchstat, Rust criterion. Use this skill whenever the user wants to benchmark code, measure performance, compare two implementations or functions, set up a benchmark harness, or asks "which is faster", "benchmark these two functions", "how do I benchmark this", "is this optimization worth it", or "interpret these benchmark results". Always use this skill for micro-benchmarking requests; it writes correct benchmarks, avoids the classic pitfalls, and explains the numbers./caching-strategy-setupAdd the right caching to an app in any stack - in-process, distributed (Redis/Valkey/Memcached), two-level, or HTTP/output caching - with correct keys, expiration, stampede protection, and invalidation. Covers HybridCache / IMemoryCache / IDistributedCache / output caching in .NET, lru-cache / keyv / cache-manager / ioredis in Node, functools / cachetools / redis-py / Django cache in Python, Spring Cache with Caffeine or Redis in Java/Kotlin, and ristretto / groupcache / singleflight / go-redis in Go. Use this skill whenever the user wants caching, to cache a query/response, Redis caching, @Cacheable, lru_cache, HybridCache, cache-aside, output caching, or asks "how do I cache this / add caching / avoid cache stampede / invalidate this cache". Always use this skill for caching requests; it picks the right layer and wires expiration + invalidation correctly.Other plugins' skills for the same job