TL;DR
While large language models (LLMs) are increasingly capable of generating functionally correct code, they suffer from a massive semantic observability gap. This paper demonstrates that LLM coding agents routinely fail to generate the necessary logging and tracing context required to diagnose production failures, leaving developers with a mountain of un-debuggable "knowledge debt."
What Problem Does This Paper Address?
Current evaluations of AI coding agents focus almost entirely on functional correctness—i.e., does the code compile and pass unit tests? However, in real-world production environments, software must also be operable. When a system inevitably fails, developers rely on observability artifacts (logs, traces, metrics) to understand what went wrong.
If an AI agent generates a massive microservice system that runs fine under normal workloads but lacks meaningful logging, it creates knowledge debt. Because developers didn't write the code themselves, they lack the mental model to debug it post-hoc. This paper investigates a critical question: Can current LLM coding agents generate code that is not only runnable, but also observable under failure?
Methods
The authors designed a multi-level evaluation framework to analyze observability at both the source-code level (statically) and the runtime level (dynamically).
- Static Observability Restoration (RQ1): To test if LLMs understand what and where to log, the authors took mature human-written repositories, stripped out all existing observability code (logging, tracing, metrics) while keeping the business logic intact, and tasked LLMs with restoring them. They measured Position F1 (did the model put logs in the right places?) and KeyBag F1 (did the model capture the right variables and semantic context?).
- Runtime Observability Evaluation (RQ2): The authors had LLMs generate 200 end-to-end microservice systems from high-level specifications. They deployed these systems on a Kubernetes cluster and used Chaos Mesh to inject 13 representative production faults (e.g., network delays, database outages, CPU stress). They measured the Fault Signals Rate (FSR)—the percentage of injected faults that produced explicit, actionable evidence in the logs.
- Observability-Oriented Guidance (RQ3): Finally, they tested whether providing the agent with a structured "Observability Skill" (mined from 200 real-world engineering commits) could bridge the gap.
Datasets
The study leverages two distinct datasets:
- Static Dataset: 1,223 code instances curated from 10 open-source GitHub repositories (such as OpenTelemetry-demo and Train-ticket) and 8 industrial datasets from Microsoft.
- Runtime Dataset: 200 unique microservice architecture specifications spanning domains like e-commerce, IoT telemetry, and finance, resulting in 1,615 executable fault instances under chaos testing.
Key Insights and Ideas
- Placement is Easy, Content is Hard: LLMs are surprisingly good at figuring out where an instrumentation statement should go (Position F1), but they struggle immensely with what to actually record (KeyBag F1). They understand the structure of code but lack the semantic foresight to log failure-relevant variables.
- Quantity $\neq$ Quality: Simply prompting an LLM to "improve observability" triggers massive over-generation. The models spit out significantly more log lines, but the precision plummets. They end up generating "semantically hollow" logs (e.g., logging
start checkoutinstead of capturing critical request IDs or error states), adding noise without helping diagnosis.
- The Silent Failure Trap: Current coding agents primarily learn from static source code rather than dynamic runtime behavior. Because they don't simulate failure propagation during training, they fail to proactively log the state context needed to catch implicit bugs like clock skews or resource contention.
Key Results
- Shockingly Low Fault Visibility: Across the board, LLM-generated microservices left the vast majority of production failures completely invisible. The overall Fault Signals Rate (FSR) ranged from a dismal 4.95% (GPT-5.5) to 13.99% (Gemini 3.5 Flash). Even when filtering only to services that successfully executed, the best model maxed out at a 20.62% FSR.
- Explicit vs. Implicit Faults: LLMs only catch faults that naturally throw loud, explicit errors (like an upstream HTTP 503 or a dead database connection). For subtle, implicit faults like network corruption or CPU stress, the FSR dropped below 2%, because the code failed to proactively track system health.
- Prompt Engineering is Not Enough: Introducing the structured "Observability Skill" prompt yielded only marginal improvements. While GPT-5.5 saw an FSR bump of +8.67 percentage points, the overall visibility remained dangerously low (under 17%).
Limitations and Future Work
The authors acknowledge that their automated log-checking oracle might miss highly indirect or subtle fault signals that a human engineer might infer. Additionally, human-written code was treated as the ground truth baseline, though human logging is rarely perfect.
Future Direction: The paper concludes that observability cannot be solved via simple prompt engineering or post-hoc fixes. Future AI coding agents must treat observability as a first-class objective, potentially integrating runtime execution feedback loops and failure-aware reasoning directly into the code generation process.
Summary updated