← Home ← Codex ← DEBT
Browse by Category
+ added · updated 7d
← Back to glossary

Distributed Tracing

Observability Intermediate
debt(d7/e5/b5/t5)
d7 Detectability Operational debt — how invisible misuse is to your safety net

Closest to 'only careful code review or runtime testing' (d7). OpenTelemetry tooling can verify traces exist, but detecting broken trace chains (missing header propagation) or missing span attributes typically requires runtime testing or manual review of inter-service calls. The code_pattern regex (traceparent|X-B3-TraceId) can find some usages, but won't catch omissions.

e5 Effort Remediation debt — work required to fix once spotted

Closest to 'touches multiple files / significant refactor in one component' (e5). The quick_fix involves adding OpenTelemetry SDK, propagating headers in ALL HTTP/queue calls, and adding custom attributes. This touches multiple integration points across the codebase—HTTP clients, queue producers/consumers, and potentially middleware layers—but doesn't require architectural rework.

b5 Burden Structural debt — long-term weight of choosing wrong

Closest to 'persistent productivity tax' (b5). Applies to web, cli, and queue-worker contexts, meaning every service interaction point must maintain trace propagation. Once adopted, all new services and communication paths must include tracing instrumentation. However, it's additive rather than architectural—the system still functions without it, unlike a core auth system.

t5 Trap Cognitive debt — how counter-intuitive correct behaviour is

Closest to 'notable trap' (t5). The misconception field explicitly states developers wrongly believe tracing replaces logging. This is a documented gotcha that most devs eventually learn—traces show flow and timing, logs show detailed events. Additionally, the 100% sampling trap and missing header propagation are common pitfalls that contradict intuitive expectations.

About DEBT scoring →

TL;DR

Distributed tracing tracks a request as it flows through multiple services — each service adds a span to a shared trace, giving end-to-end visibility into latency and failures.

Explanation

A trace represents one request journey. Each service adds a span (operation + timing). Spans link via trace ID + parent span ID propagated in headers (W3C Trace Context: traceparent header). Tools: Jaeger, Zipkin, Datadog APM, AWS X-Ray, Honeycomb. OpenTelemetry: the standard SDK for instrumentation. PHP: opentelemetry-php SDK, Laravel/Symfony integration. Key use: find where in a multi-service request the latency is — which service is slow, which DB query takes 2s. Without tracing, cross-service debugging requires correlating logs by timestamp — fragile and slow.

Common Misconception

Distributed tracing replaces logging — they're complementary. Traces show the request flow and where time is spent; logs show what happened within each service.

Why It Matters

Distributed tracing is the only way to efficiently debug latency issues in microservices — without it, finding which of 10 services is slow requires educated guessing.

Common Mistakes

  • Not propagating trace headers between services — breaks the trace chain.
  • 100% sampling in production — high volume, high cost. Use sampling.
  • Not adding custom attributes to spans — spans without context are hard to use.

Code Examples

✗ Vulnerable
// No trace propagation — broken traces:
$response = $httpClient->post('/api/orders', $data);
// No traceparent header passed — downstream sees a new root trace
✓ Fixed
// Propagate W3C trace context:
$response = $httpClient->post('/api/orders', $data, [
    'headers' => [
        'traceparent' => $tracer->getCurrentSpan()->getContext()->getTraceId(),
    ]
]);

// OpenTelemetry PHP:
$span = $tracer->spanBuilder('processOrder')->startSpan();
$span->setAttribute('order.id', $orderId);
try { processOrder(); }
finally { $span->end(); }

Added 23 Mar 2026
Views 129
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings T 0 pings W 1 ping T 0 pings F 0 pings S 0 pings S 0 pings M 1 ping T 0 pings W 5 pings T 3 pings F 3 pings S 5 pings S 5 pings M 0 pings T 2 pings W 0 pings T 0 pings F 0 pings S 0 pings S 0 pings M 0 pings T 0 pings W 0 pings T 0 pings F 0 pings S 1 ping S 0 pings M 0 pings T 0 pings W
No pings yet today
No pings yesterday
Google 40 Scrapy 22 Amazonbot 18 Perplexity 12 Ahrefs 5 Unknown AI 3 ChatGPT 3 Majestic 2 Claude 2 Meta AI 1
crawler 104 crawler_json 3 pre-tracking 1
DEV INTEL Tools & Severity
🟠 High ⚙ Fix effort: High
⚡ Quick Fix
Add OpenTelemetry SDK. Propagate W3C traceparent header in all HTTP/queue calls. Add custom span attributes for key IDs. Sample 5-10% in production.
📦 Applies To
web cli queue-worker Laravel Symfony
🔗 Prerequisites
🔍 Detection Hints
traceparent|X-B3-TraceId
Auto-detectable: ✗ No opentelemetry
🤖 AI Agent
Confidence: Low False Positives: High ✗ Manual fix Fix: High Context: File


✓ schema.org compliant