Benchmarking LLMs on raw container logs vs. structured OpenTelemetry span trees and commit diffs

An empirical Scenario 12 benchmark showing why pasting raw Docker stdout logs makes LLMs hallucinate runtimes and function signatures, while structured OpenTelemetry span trees and commit diffs isolate the exact line and patch.

I fired three HTTP test requests against checkout at 14:49 UTC. One healthy request returned 200, the next two crashed with HTTP 500 TypeError, and container CPU stayed completely flat.

Most incident responders react to that screen in one predictable way. They grab the stack trace out of container stdout, paste those lines into Claude or ChatGPT, and ask the model why production crashed and how to stabilize the cluster.

On November 30, I ran a controlled side-by-side benchmark using Scenario 12 (scenarios/12-regression-suspect-commit-pr) from our open-source Formatio Failure Lab. Both conditions hit a live Node.js service (https://node-example.formatio.cloud, running commit bd87059 on Docker Swarm).

In Condition A, I pasted raw Express stdout logs into Claude. In Condition B, the model inspected structured OpenTelemetry span trees, grouped errors, and commit context inside Formatio and over scoped MCP tools.

Even on a straightforward synchronous TypeError, raw log text forced the model to hallucinate the wrong container orchestrator, break the real API signature, and ask me to copy-paste application files back into chat. Structured trace waterfalls resolved both crashes in milliseconds without a single manual log copy.

What separated raw container logs from OpenTelemetry span trees?

Read all four dimensions in the comparison table below to see where an identical Node.js stack trace sent each workflow after the same failing checkout requests (verified 2026-11-30).

Benchmark dimension Condition A: raw Docker stdout logs into Claude Condition B: OpenTelemetry span tree + commit context
Input context supplied 8-line flat Express log timestamp + TypeError stack trace 3.7 ms · 7 spans OTLP waterfall, [ORIGIN] child span (558 µs), started in bd87059
Runtime & cluster accuracy Assumed Kubernetes (kubectl rollout undo) on a Docker Swarm deployment Bound directly to the active Docker Swarm container and commit bd87059
Patch API shape accuracy Invented cartTotal(items = []) with i.price * i.qty, breaking { items: [{ cents }] } Preserved cart.items, item.cents, and order.coupon.percentOff contracts
Human copy-paste hops Requested discount.js and app.js:306 before writing a verified patch Zero manual stdout pastes; local agent reads discount.js or reviews branch fix PR

Look closely at row two and row three in that table. Raw stack frames already contain the crashing filename and line number (discount.js:5:21), yet omitting runtime topology, parent spans, and schema shape forces even strong frontier models to invent missing context.

To test reproducibility, I triggered all three routes from Scenario 12 directly against the edge endpoint:

1) GET /ai-sre/cart-total -> HTTP 200 OK
{"totalCents":250}

2) GET /ai-sre/cart-total?empty=1 -> HTTP 500 Internal Server Error
{"error":"TypeError","message":"Cannot read properties of undefined (reading 'reduce')"}

3) POST /api/lab/scenarios/12-regression -> HTTP 500 Internal Server Error
{"error":"TypeError","message":"Cannot read properties of undefined (reading 'percentOff')"}

All three responses came back deterministic in milliseconds (CF-RAY edges LHR and CDG). The healthy path passed immediately, while empty carts and missing coupons threw synchronous runtime exceptions inside apps/node-express/discount.js before any container restarted.

Compare the structural information loss between those two debugging paths in the cause-and-effect diagram below.

Cause-and-effect comparison showing why raw stdout makes LLMs guess while OTel span trees ground remediation

Trace both tracks from left to right in the diagram above. Because flat container stdout strips request hierarchy, container orchestrator identity, and deployment version metadata before the text reaches a chat window, Condition A enters an unverified guessing loop while Condition B narrows straight to exact guard patches.

Why did pasting container stdout into Claude fail on a clean stack trace?

When you paste stdout from docker compose logs or CloudWatch into a standalone chat session, the model has only what those eight lines carry. Here is the exact payload fed into Condition A:

2026-11-30T14:49:54Z [express] GET /ai-sre/cart-total?empty=1 500 in 3.7ms
TypeError: Cannot read properties of undefined (reading 'reduce')
    at cartTotal (/app/node-express/discount.js:5:21)
    at /app/node-express/app.js:306:26
    at Layer.handleRequest (/app/node-express/node_modules/router/lib/layer.js:169:33)
    at AsyncLocalStorage.run (node:internal/async_local_storage/async_hooks:91:14)
    at next (/app/node-express/node_modules/router/lib/route.js:163:13)
    at Route.dispatch (/app/node-express/node_modules/router/lib/route.js:123:3)

Claude hit four distinct operational failures that waste senior engineering time during real production outages:

1. Explicit source blindness on the crashing function

Right at the top of its diagnosis, Claude admitted on screen: "I can't see your source, so this diagnosis comes from the stack trace alone." That string (at cartTotal (/app/node-express/discount.js:5:21)) tells an LLM which property threw .reduce(). It never shows what parameter shape cartTotal expects or how callers build that object.

2. Orchestrator hallucination (kubectl rollout undo on Docker Swarm)

Without deployment metadata attached to the crash, Claude assumed the cluster ran Kubernetes and led with kubectl rollout history, kubectl rollout undo deployment/<service> -n <ns>, and kubectl rollout status. Yet node-example.formatio.cloud runs on Docker Swarm, not Kubernetes. Even when asked "what does it mean?", the model hedged across docker inspect -> OOMKilled, missing Content-Type: application/json headers, and missing express.json() registration because raw text gives zero infrastructure truth.

3. Breaking code signature hallucinations

This is the subtlest danger in log-only LLM debugging. Look at the actual production functions sitting inside apps/node-express/discount.js (lines 3–17) and apps/node-express/app.js (lines 304–312):

// apps/node-express/discount.js (actual code on bd87059)
function cartTotal(cart) {
  return cart.items.reduce((total, item) => total + item.cents, 0);
}

function calculateCheckoutTotal(order) {
  const subtotal = Number(order.amountCents || 0);
  const pct = order.coupon.percentOff;
  return {
    subtotalCents: subtotal,
    discountPercent: pct,
    finalCents: Math.max(0, Math.round(subtotal * (1 - pct / 100))),
  };
}

And here are the two route handlers calling those helpers in apps/node-express/app.js:

app.get('/ai-sre/cart-total', (req, res) => {
  const cart = req.query.empty === '1' ? {} : { items: [{ cents: 250 }] };
  res.json({ totalCents: cartTotal(cart) });
});

app.post('/api/lab/scenarios/12-regression', (req, res) => {
  const result = calculateCheckoutTotal(req.body || {});
  res.json({ status: 'ok', result });
});

Without reading discount.js, Claude guessed function cartTotal(items = []) using i.price * i.qty, paired with a route boundary check expecting req.body?.items to be an array. Shipping that generated snippet verbatim would break every healthy { items: [{ cents: 250 }] } call in production by rejecting an object payload and computing NaN from nonexistent .price and .qty fields.

4. Turning the engineer into a manual data concierge

Faced with uncertainty, Claude pushed context-gathering back onto the responder. It asked me to check discount.js:5 and app.js:306 locally and paste both files back into chat before it could write a safe patch and test. Instead of isolating root cause, chat-based log debugging turns engineers into human copy-paste buses hopping between terminal stdout, GitHub tabs, and prompt boxes—the workflow friction dissected in connecting coding agents via /mcp.

How did structured OpenTelemetry span trees pinpoint both bugs?

Now examine Condition B against the same three HTTP requests. No sidecar collector agents ran on node-express. Telemetry arrived via build-time Railpack instrumentation (/opt/formatio), which automatically covers supported Node.js 18.19+, Go, Python 3.10+, Java, and .NET 8+ builds, while Dockerfiles, Nixpacks, Next.js 15+, and Fastify attach a 2–3 line SDK hook (our sidecars vs. Railpack breakdown).

Open Tools › Traces in the live capture below to inspect the GET /ai-sre/cart-total waterfall recorded at 11/30/2026, 3:49:54 PM (UTC+1 local browser time, matching the 14:49:54 UTC trigger).

Formatio Tools Traces waterfall for GET /ai-sre/cart-total showing 3.7 ms total across 7 spans with ORIGIN badge

Pay attention to row six inside that waterfall screenshot: the full request completed in 3.7 ms total · 7 spans across node-express. Execution crossed the outer middleware and Express JSON parser (232 µs, 72 µs, and 1.1 ms) plus the outer handler in 974 µs. Formatio then stamped request handler - /ai-sre/cart-total (558 µs) with the red ORIGIN badge. In multi-service outages, tagging that earliest failing span matters even more because downstream workers throw louder secondary errors (see our 3-service 502 origin teardown).

Clicking View error group -> beneath the exception event links straight from the 558 µs span into grouped issues inside Tools › Errors shown below.

Formatio Tools Errors index showing 2 open issues across 65 occurrences over the last 7 days

Notice how Tools › Errors deduplicates noisy traffic in that overview capture. Across 65 recorded occurrences over seven days (including three resolved issues), the Open filter isolates two active rows: calculateCheckoutTotal reading 'percentOff' twice, and cartTotal reading 'reduce' three times. Clicking either row opens its root-cause workspace card without copying trace IDs across browser tabs.

How did AI telemetry triage handle commit attribution and container frames?

Inspecting the cartTotal detail capture below reveals both where automated triage shines and what nuance engineers should verify before merging a fix.

Formatio Tools Errors detail for cartTotal showing AI advisor suggestion, started in bd87059, and Fix buttons

Look closely at three regions in that detail screenshot:

  1. Top-right action controls: Fix, Copy fix prompt, and Resolve sit directly beside the fingerprint header (3 occurrences · first seen 5d ago · last seen 3m ago).
  2. Honest suspect-commit confidence: Deployment correlation stamps started in bd87059 while deterministic commit scoring reports No suspect commit. and the AI Error Advisor (OpenRouter · z-ai/glm-5.3-flash) labels itself low confidence. Why? This buggy route lived on baseline commit bd87059 for five days rather than shipping in a new diff today, so suspect scoring refuses to invent false commit blame.
  3. Exact line attribution regardless: Even with zero newly introduced diff, reading discount.js:5 alongside caller app.js:306 led the built-in advisor straight to the right null-safe expression ((cart.items || []).reduce(...)), matching our AI error advisor documentation rules on evidence-backed framing.

Next, examine the second open issue (calculateCheckoutTotal on POST /api/lab/scenarios/12-regression) in the screenshot below to check stack frame path resolution inside containerized builds.

Formatio Tools Errors detail for calculateCheckoutTotal showing AI advisor percentOff guard and container stack frames

Look at the AI advisor panel (medium confidence) and the Latest stack trace panel directly beneath Regenerate in that capture. The advisor pinpoints discount.js:11 and caller app.js:310, suggesting an illustrative guard (discount?.percentOff ?? 0). Why a placeholder name instead of order?.coupon?.percentOff? Look directly underneath at node-express/discount.js:11:28. Because the container runs /app/node-express/discount.js rather than the monorepo Git path (apps/node-express/discount.js), the inline frame viewer reports Source is not available for this frame. while preserving exact coordinates.

That limitation is why pairing automated branch fix PRs with interactive IDE loops works so well, as traced in the system map below.

System map showing determinism loop from OpenTelemetry origin span to GitHub App fix PR and local IDE over /mcp

Follow the two rightward branches from box two in that system map:

  • Path 3a (GitHub App branch fix PR): On eligible open issues with line- or file-level deploy attribution, Formatio inspects the affected file at default-branch head and opens a branch pull request. Daily caps default to 5/app and 25/org (UTC), and Formatio never runs your tests, auto-merges, or pushes to main (automated fix pull requests docs).
  • Path 3b (Interactive local editor via POST /mcp): When container paths diverge from monorepo Git layout, or when you need local tests and multi-file edits on apps/node-express/discount.js, coding agents query /mcp directly. Cursor, Claude Code, Codex, and GitHub Copilot fetch bounded frames (get_occurrence, 64 KiB cap) and span waterfalls (get_trace). Follow-up calls inspect runtime logs (get_logs, 2 KiB/line cap), while get_application returns secret names only.

Here is the verified scenarios/12-regression-suspect-commit-pr/solution.patch for apps/node-express/discount.js preserving every existing field contract:

function cartTotal(cart) {
  return (cart?.items || []).reduce((total, item) => total + item.cents, 0);
}

function calculateCheckoutTotal(order) {
  const subtotal = Number(order.amountCents || 0);
  const pct = Number(order?.coupon?.percentOff || 0);
  return {
    subtotalCents: subtotal,
    discountPercent: pct,
    finalCents: Math.max(0, Math.round(subtotal * (1 - pct / 100))),
  };
}

Both cart?.items and item.cents remain untouched, and both endpoints switch straight back from HTTP 500 to 200. You can step through this exact crash, trace waterfall, and Claude vs. OTel prompt run inside the 7-minute FL12-BENCHMARK live screen walkthrough (YouTube and failure lab pack).

Which empirical numbers actually held up in Scenario 12?

Stepping back from UI screenshots to measurable engineering outcomes, review all four criteria in the empirical scorecard chart below (measured 2026-11-30).

Scenario 12 empirical verification scorecard comparing raw container logs in Claude against Formatio OpenTelemetry span trees

Read down rows two, three, and four in that scorecard chart carefully:

  1. Line identification is table stakes (100% vs 100%): Both workflows extracted discount.js:5 and app.js:306 right away because Express prints JS file paths into stdout.
  2. Infrastructure & runtime accuracy diverged sharply: Pasting logs caused Claude to hallucinate Kubernetes rollback commands against a Docker Swarm service, whereas trace and deploy metadata kept Condition B anchored to the live Swarm container (bd87059).
  3. API contract fidelity decided whether the patch shipped safely: Condition A's invented cartTotal(items = []) helper (i.price * i.qty) failed on real { items: [{ cents: 250 }] } objects; structured trace coordinates plus /mcp local source inspection preserved the true contract.
  4. Engineer toil dropped from manual busing to review: Condition A required checking source locally and pasting two files back into chat, whereas Condition B delivered diagnosis, Copy fix prompt, and GitHub App fix PR automation from one trace click (see trace inspection docs and automatic fix PR ship notes).

Want to test this exact benchmark before trusting AI debugging tools on production traffic? Fork scenarios/12-regression-suspect-commit-pr in formatio-failure-lab. If you're evaluating an internal developer platform for teams building with AI coding agents like Cursor and Claude Code, you must inspect trace depth alongside deploy governance. Start a 14-day free trial on your own hosts for multi-runtime deploys, OTel observability, AI SRE fix PRs, /mcp, and SSO governance at $200/month flat.

Frequently asked questions

Why do frontier LLMs hallucinate runtime commands and code signatures on clean stack traces?

An exception stack trace identifies which file and line threw an error, not which container orchestrator runs the service, which git commit changed behavior, or what object schema callers pass in. Faced with that missing execution context, language models default to statistical priors—assuming Kubernetes (kubectl rollout) over Docker Swarm and inventing common tutorial schemas (items[].price * qty) that silently break production contracts.

What telemetry metadata turns LLM debugging from guessing into deterministic localization?

Deterministic triage binds four metadata fields to each failure event: the W3C traceparent waterfall with earliest-span origin attribution, active container identity, deployment lineage (service.version plus timestamps), and stack frames mapped to repo paths. Carrying those attributes in OpenTelemetry spans lets error groups deduplicate bursts, grade suspect commits honestly, and feed coding agents exact coordinates rather than truncated syslog streams.

How can Claude Code or Cursor connect to production stack traces and logs via MCP without leaking secrets?

Connect your editor over Streamable HTTP to a scoped Model Context Protocol endpoint (POST /mcp) backed by expiring bearer tokens instead of personal SSH keys or raw cloud credentials (MCP client setup guide). Agents start with grouped summaries (list_issues and get_issue) before fetching bounded stack frames via get_occurrence (64 KiB cap). Follow-up calls inspect get_trace span waterfalls and get_logs lines (2 KiB/line cap) while environment secret values remain names-only and redacted at the API boundary.