aj-geddes avatar

Correlation Tracing

This implements correlation IDs and distributed tracing across microservices so you can follow requests through your system. You get Express middleware that generates or extracts trace IDs, AsyncLocalStorage for context propagation, and integration patterns for OpenTelemetry. The skill includes Python implementations too, not just Node. Use it when you're debugging why requests are slow or failing in a distributed system and you need to see the full path. The practical bit is the structured logging integration, so your correlation IDs actually show up where you need them. Just watch your sampling rates in production or you'll drown in trace data.

skills.sh installs
429
GitHub stars
379
last updated
Aug 21, 2026

Install

$ npx -y skills add aj-geddes/useful-ai-prompts --skill correlation-tracing --agent claude-code

Installs into .claude/skills of the current project.

Files

Correlation & Distributed Tracing

Table of Contents

Overview

Implement correlation IDs and distributed tracing to track requests across multiple services and understand system behavior.

When to Use

  • Microservices architectures
  • Debugging distributed systems
  • Performance monitoring
  • Request flow visualization
  • Error tracking across services
  • Dependency analysis
  • Latency optimization

Quick Start

Minimal working example:

import express from "express";
import { v4 as uuidv4 } from "uuid";

// Async local storage for context
import { AsyncLocalStorage } from "async_hooks";

const traceContext = new AsyncLocalStorage<Map<string, any>>();

interface TraceContext {
  traceId: string;
  spanId: string;
  parentSpanId?: string;
  serviceName: string;
}

Sponsors

Details

Repository
github.com/aj-geddes/useful-ai-prompts
Categories
DevOps & CI/CD, AI & Agent Building, Debugging
First seen
Jun 3, 2026

More from aj-geddes/useful-ai-prompts

All 258
1depot avatardepot-generaldepot/skillsHandles Depot CLI installation, authentication, login, project setup, organization management, and API access. Use when installing the Depot CLI, logging in wit429skills.sh installs
2wedsamuel1230 avatararduino-project-builderwedsamuel1230/arduino-skillsBuild complete, production-ready Arduino projects (environmental monitors, robot controllers, IoT devices, automation systems). Assembles multi-component system421skills.sh installs
3secondsky avatarhealth-check-endpointssecondsky/claude-skillsHealth check endpoints for liveness, readiness, dependency monitoring. Use for Kubernetes, load balancers, auto-scaling, or encountering probe failures, startup420skills.sh installs
4tencentcloudbase avatarcloudbase-agent-tstencentcloudbase/skillsBuild and deploy AI agents with Cloudbase Agent (TypeScript), a TypeScript SDK implementing the AG-UI protocol. Use when: (1) deploying agent servers with @clou420skills.sh installs
5brightdata avatarscraper-builderbrightdata/skillsBuild production-ready web scrapers for any website using Bright Data infrastructure. Guides you through site analysis, API selection, selector extraction, pagi415skills.sh installs
6jezweb avatarclaude-agent-sdkjezweb/claude-skillsBuild autonomous AI agents with Claude Agent SDK. Structured outputs guarantee JSON schema validation, with plugins system and hooks for event-driven workflows.415skills.sh installs