Skip to content

Tracing & OpenTelemetry

.md

Every model invocation, tool execution, and agent turn in Dewee generates structured OpenTelemetry-compatible traces (internal/tracing/).

  • Span Hierarchy: agent_run → model_turn → tool_execution → observation_capture.
  • Prompt Cache Metrics: Tracks cache read and cache creation tokens for Anthropic and OpenAI models.
  • Cost Rollups: Calculates estimated token expenses per session and workspace.
Terminal window
# Follow real-time trace stream from the gateway
dewee traces follow
# List recent execution traces with error status
dewee traces list --status error
# Include background worker decision traces, which lists hide by default
dewee traces list --include-background
# Inspect full structured JSON span details
dewee traces get <trace-id>
# Export trace data for external ingestion
dewee traces export <trace-id>

Reflex decisions from background workers (channel memory batches, knowledge-graph chunks and dreaming) that run outside any agent run get their own short-lived trace tagged origin:background. Trace lists hide these by default in RGD, CCP, GET /v1/traces and dewee traces list. Turn on “Show background traces” in RGD or CCP, pass include_background=true to the API, or use --include-background on the CLI to show them. Opening a trace by ID always works. Traces recorded before this tag existed stay visible.