Skip to main content

Overview

Observability in Coevolved is built on structured events emitted during execution. You use tracing to answer questions like:
  • Which steps ran (and in what order)?
  • Where did time go?
  • What did the LLM return (text vs tool calls)?
  • Which tool executed, with what args, and what result?

Tracing configuration

Start by deciding what you want to capture:
  • step lifecycle events (start/end/error)
  • snapshots (commonly: input snapshot only on errors)
  • LLM prompt text (often off by default for privacy and cost)
If you need richer debugging, enable additional snapshots in a controlled environment.

Sinks and formatters

Sinks receive events; formatters turn them into log lines or structured payloads. Common approaches:
  • local dev: console sink with a compact formatter
  • staging: JSON lines to a file (JSONL)
  • production: forward events into your logging/metrics pipeline
Here’s a simple JSONL setup:
from coevolved.base import (
    ConsoleSink,
    JSONLSink,
    Tracer,
    make_verbose_jsonl_serializer,
    set_default_tracer,
)

serializer = make_verbose_jsonl_serializer(
    include_none=True,
    add_timestamp_iso=True,
)
tracer = Tracer(
    sinks=[
        ConsoleSink(),
        JSONLSink("coevolved.trace.jsonl", serializer=serializer),
    ]
)
set_default_tracer(tracer)

Redaction and privacy

Treat prompts, tool args, and snapshots as potentially sensitive. Recommended defaults:
  • Don’t log full prompt text unless you explicitly need it
  • Capture snapshots on errors only
  • Implement a redactor for hashing/logging when state can contain secrets
If you handle user data, ensure your logging and retention policies match your security and compliance requirements.

Next steps