← Home ← Codex ← DEBT ← Engine
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 281
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
1 ping S 0 pings S 0 pings M 0 pings T 1 ping 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 1 ping F 0 pings S 2 pings S 0 pings M 2 pings T 0 pings W 1 ping T 0 pings F 0 pings S 0 pings S 0 pings M 1 ping T 1 ping W 1 ping T 0 pings F 0 pings S 0 pings S
No pings yet today
No pings yesterday
Google 46 Amazonbot 32 Scrapy 22 PetalBot 17 Perplexity 16 Ahrefs 12 ChatGPT 7 SEMrush 5 Bing 4 Unknown AI 3 Claude 3 Majestic 2 Twitter/X 2 Applebot 2 Meta AI 1 Brave Search 1 Baidu 1
crawler 171 crawler_json 4 pre-tracking 1
🧱 FUNDAMENTALS — new to this? Start with the ground floor.
Root Cause observability The root cause is the deepest reason an incident happened — the thing that, if it had not occurred, the failure would not have happened. It is different from the symptom you first noticed.

Fixing symptoms without finding root cause means the same incident returns next week. Every senior engineer eventually learns that 'restarted the server, it's fine now' is not a resolution.

💡 Ask 'but why did that happen?' at least five times before you call it resolved.

Ask Codex about Root Cause →
Telemetry observability Telemetry is the data your software sends out about itself while it runs — things like logs, numbers, and timing info — so you can see what it's doing from the outside.

You can't fix what you can't see, and production behavior almost never matches what you tested locally. Telemetry is how professional software stays debuggable after it leaves your laptop.

💡 If it runs in production, it should emit at least one log, metric, or trace — otherwise you're flying blind.

Ask Codex about Telemetry →
⚡ 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