Observability
This page explains log writing, redaction, capture boundaries, and protocol-ID implementation. See logs and diagnostics for locations, commands, and rotation, or troubleshooting for symptoms. See state and storage for persistence implementation and session records and SQLite for read-only inspection.
Logs
The log guide owns file layout and reading instructions. The Python writer is logging.py; the shared Node writer is logging.mjs. Keep their output format, rotation, and error fallback aligned with the user guide whenever you touch either implementation.
Each log line is a JSON object containing timestamp, level, component, and message, with stage, requestId, threadId, runId, and code when context is available. Exception stacks use stack; Node exceptions use error.stack. File logs retain newlines and complete stacks while JSON encoding keeps each event on one physical line. User-visible safe_error still returns a short summary of at most 1,500 characters.
All three logs redact before writing, covering known secrets, Bearer/Basic authentication, URL credentials, and signed parameters. Plugins use logging.getLogger(__name__) instead of installing their own file handlers. Extension refresh registers new credentials while retaining redaction for old ones, covering older runs still executing.
Known credentials include model keys, semantic-service passwords, authentication tokens, and explicit credential environment variables, headers, and arguments in MCP definitions, such as API_KEY, Authorization, --token, and --password=<value>. Usernames, service URLs, and ordinary command arguments remain available for diagnosis. Credentials shorter than eight characters match only complete values to avoid replacing ordinary words or path fragments; credential fields and authentication inside URLs are still redacted.
All writers rotate at 5_000_000 bytes and keep three backups; log files use mode 0600. Backend file-initialization failure falls back to identically redacted and formatted stderr. A write failure emits one warning so logging errors do not obscure the original exception.
When dataagent serve, Web npm start, or TUI runs independently, each service writes its corresponding file. When launched by a supervisor, the internal DATAAGENT_LOG_CAPTURE marker makes child processes emit logs only; the launcher persists them through the same writer to avoid duplicate records. The launcher manages this marker; users should not set it manually. TUI's short summary of backend stderr is for error display only; full content still reaches backend.log.
Browsers report page exceptions, unhandled Promises, and client communication failures through same-origin /api/client-errors, eventually reaching web.log. Clients deduplicate repeated reports; the server bounds report frequency and body size. Reports can fail during network outages while the interface continues running. backend.log is authoritative for complete runtime-failure diagnostics; clients display safe summaries.
Browser reporting allows up to 60 records and 1 MiB of accepted report bodies per minute per Web process, with a 32 KiB maximum individual body. All sources share this quota; client x-forwarded-for does not define quota groups. Allowed Origin comes from DATAAGENT_WEB_ORIGIN, the Next.js internal listener Origin, or the request URL Origin, in that order. Behind a reverse proxy or wildcard listener, set DATAAGENT_WEB_ORIGIN to the browser's actual Origin. Validation does not directly trust client-supplied Host or forwarding headers. Origin and Fetch Metadata validate browser sources rather than authenticating clients; browser-reported run IDs remain untrusted diagnostic data.
Log levels and entry-point boundaries
| Entry point | Default behavior |
|---|---|
dataagent serve, serve-a2a |
Console defaults to INFO and can be adjusted with DATAAGENT_CONSOLE_LOG_LEVEL. The file backend.log retains INFO and higher |
| TUI | INFO by default; code-level setDebugMode / setLogLevel can change UI logging, with no corresponding public CLI or environment option |
| Web and launchers | Shared writer records the caller's selected level; Web console log/info, warn, and error map to INFO, WARN, and ERROR |
| Direct SDK calls | No automatic file-log setup or exception capture; custom hosts can call configure_logging explicitly |
Set DATAAGENT_CONSOLE_LOG_LEVEL=DEBUG before launch to see backend DEBUG messages on the console. Supported levels are DEBUG, INFO, WARNING, ERROR, and CRITICAL; an invalid value makes startup fail. The backend file still records INFO and higher, so DEBUG stays visible on the console only. This variable controls backend output and leaves the Web and TUI log levels alone. Python uses WARNING and Node uses WARN, so include both when searching.
A2A correlation
Receive, completion, cancellation, and failure events for /a2a/jsonrpc use the same backend writer, with one JSON object per line. Top-level correlation fields include request_id, rpc_id, message_id, context_id, task_id, root_run_id, instance_id, and process user_id. Anonymous access does not identify the actual visitor; user_id is not caller identity.
Main events are a2a.request.received/finished/aborted/rejected/failed, a2a.assembly.queued/started/completed/failed/cancelled, a2a.task.cancel_requested, a2a.checkpoint.saved/unchanged/failed, a2a.cleanup.failed, and a2a.trace.saved/failed. HTTP completion records distinguish http_status, rpc_error_code, and task_state; HTTP 200 does not establish task success.
Failure records include error_code, stage, a redacted safe summary, and frames containing up to 12 stack-frame locations. They omit local variables, full request bodies, model prompts, and tool results. Fields are individually redacted and bounded so long errors cannot truncate the JSON record or following correlation IDs. Ordinary exception stack fields and traces can supply additional diagnostics; not every A2A audit contains a complete stack.
Search first by response X-Request-ID or Task ID, then use root_run_id to find native_run_id and trace_file in a2a.trace.saved. The session index retains only the last run and checkpoint; historical relationships depend on retained logs and traces.
Traces
When tracing is enabled, completion of an Agent root execution attempts to write local OTLP JSON. See execution traces and OTLP file format for paths, fields, completeness at termination, and request-ID relationships. Verify execution status and business data separately.
See trace files and evaluation framework integration for local fields and mappings into an in-house framework. For online ingestion by your own collector, see live trace export (OTLP).
Stream identifiers
SSE RUN_FINISHED.metadata.durationMs describes only the server-side duration of this turn. It is not saved in checkpoints. TUI's completion line likewise exists only in the interface.