distributed-tracing

Implement OpenTelemetry distributed tracing across microservices with sampling and Jaeger or Tempo export.

1|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/kalilurrahman/kr-claudiator-skills-original-prompts --skill distributed-tracing-kalilurrahman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: distributed-tracing
Source: https://github.com/kalilurrahman/kr-claudiator-skills-original-prompts/tree/main/03-data-analytics/distributed-tracing
Command: npx skills add https://github.com/kalilurrahman/kr-claudiator-skills-original-prompts --skill distributed-tracing-kalilurrahman

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires opentelemetry-sdk, opentelemetry-exporter-otlp-proto-grpc, opentelemetry-instrumentation-fastapi, opentelemetry-instrumentation-httpx, opentelemetry-instrumentation-sqlalchemy, opentelemetry-instrumentation-redis, @opentelemetry/sdk-node, @opentelemetry/auto-instrumentations-node, @opentelemetry/exporter-trace-otlp-grpc.

What problem does it solve? Debugging latency and failures in microservices is guesswork without visibility into how a single request propagates across services. This Skill instruments services with OpenTelemetry so every request carries trace context, timing, and error data end to end. ## Core Features & Use Cases - Auto-Instrumentation: Set up tracing for FastAPI (Python) and Express (Node.js) with automatic spans for HTTP, SQLAlchemy, Redis, and outbound HTTP calls. - Sampling & Collector Configuration: Configure head-based and tail sampling so errors are always captured while high-traffic spans are sampled at 1-10%, routed through an OpenTelemetry Collector to Jaeger or Grafana Tempo. - Trace-Based Debugging: Query the Jaeger API to find slow traces and error traces, identify the slowest span, and correlate logs with trace IDs. - Use Case: A checkout request times out intermittently across five services. With tracing enabled, you open Jaeger, find the slow trace, and see that the payment service's database query span accounts for 900ms of the 1.2s total. ## Quick Start Instrument my FastAPI order service with OpenTelemetry tracing, sampling 5% of requests and exporting to Jaeger via an OTLP collector.

Frequently Asked Questions about distributed-tracing

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

FAQPage Schema
How do I add OpenTelemetry tracing to a FastAPI application?

Create a TracerProvider with a resource and sampler, add a BatchSpanProcessor with an OTLP exporter, then call FastAPIInstrumentor.instrument_app on your app. Also instrument HTTPX, SQLAlchemy, and Redis so outbound calls and database queries produce child spans automatically.

How to set up distributed tracing in Node.js Express?

Use the OpenTelemetry NodeSDK with getNodeAutoInstrumentations, an OTLP trace exporter, and a TraceIdRatioBasedSampler, loading it before any other imports. Auto-instrumentation covers HTTP and PostgreSQL, and you can add custom spans with tracer.startActiveSpan in route handlers.

Jaeger vs Grafana Tempo for trace storage?

Both accept OTLP spans from the OpenTelemetry Collector, so you can export to either or both simultaneously. Jaeger provides an all-in-one UI for trace search, while Tempo integrates with Grafana dashboards and uses object storage for lower-cost retention.

What sampling rate should I use in production?

Use 100% sampling in dev and staging, and 1-10% for high-traffic production services. Combine this with tail sampling in the collector so 100% of error traces and slow traces above a latency threshold are always captured regardless of the base rate.

Why are my traces broken across services?

Broken traces usually mean context propagation is missing on an outbound call. Every HTTP request, message, or job must inject the W3C traceparent header, and the receiving service must extract it to create child spans under the same trace ID.

Should I trace health check endpoints?

No, exclude health and metrics endpoints from instrumentation since they flood the backend with useless spans. Use excluded_urls in FastAPI instrumentation, ignoreIncomingRequestHook in Node.js, or a filter processor in the collector.