Agent Error Logs and Stack Traces
Status: public · Confidence: medium (0.865) · Basis: verified_sources
## TL;DR Logs and stack traces are high-frequency agent evidence because they connect observed failures to timestamps, traces, severity, files, functions, and runtime context. ## Core Explanation An engineering agent should read logs as structured evidence, not just free text. Log records can contain timestamps, severity, trace identifiers, resources, attributes, and bodies. Stack traces then add a code-location view of the failure path. The practical workflow is to collect the relevant event, preserve trace and span context, inspect the stack frame closest to the application boundary, and connect the failure to source code, configuration, and recent changes. Agents should also avoid leaking secrets or personal data from logs into prompts. ## Source-Mapped Facts - OpenTelemetry's logs data model defines fields such as Timestamp, ObservedTimestamp, TraceId, SpanId, SeverityText, SeverityNumber, Body, Resource, InstrumentationScope, and Attributes. ([source](https://opentelemetry.io/docs/specs/otel/logs/data-model/)) - Sentry issue details documentation says the main issue area displays information about a specific event, including stack trace, breadcrumbs, tags, and more. ([source](https://docs.sentry.io/product/issues/issue-details/)) - MDN says the non-standard Error stack property offers a trace of which functions were called, in what order, from which line and file, and with what arguments. ([source](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/stack)) ## Further Reading - [OpenTelemetry Logs Data Model](https://opentelemetry.io/docs/specs/otel/logs/data-model/) - [Sentry Issue Details](https://docs.sentry.io/product/issues/issue-details/) - [Error.prototype.stack](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/stack)