AgenTopology

Observability

Configure tracing, spans, and capture for debugging and monitoring agent execution

Observability

The observability block configures tracing and capture for your topology. It generates structured trace data that helps you debug agent behavior, identify bottlenecks, and monitor execution in production.

Basic Syntax

observability {
  tracing: true
  spans: [agent, tool, flow]
  capture: [inputs, outputs, errors]
}

Field Reference

FieldTypeRequiredDescription
tracingbooleanNoEnable or disable tracing (default: false)
spanslistNoWhat to generate spans for
capturelistNoWhat data to capture in spans
outputstringNoFile path for trace output
formatidentifierNoOutput format (e.g. json, otlp)

Span Types

SpanDescription
agentOne span per agent execution
toolOne span per tool invocation
flowOne span per flow edge traversal
gateOne span per gate evaluation
groupOne span per group discussion round
observability {
  tracing: true
  spans: [agent, tool, flow, gate]
}

Capture Options

OptionDescription
inputsCapture input data for each span
outputsCapture output data for each span
errorsCapture error details
timingCapture start time, end time, and duration
tokensCapture token usage per span
observability {
  tracing: true
  spans: [agent, tool]
  capture: [inputs, outputs, errors, timing, tokens]
}

Output Configuration

Write trace data to a file:

observability {
  tracing: true
  spans: [agent, tool, flow]
  capture: [inputs, outputs, errors, timing]
  output: "traces/run.json"
  format: json
}

Formats

FormatDescription
jsonJSON array of spans
otlpOpenTelemetry Protocol format for integration with tracing backends

Full Example

topology observable-pipeline : [pipeline] {
  agent researcher {
    model: sonnet
    tools: [WebSearch, Read]
  }

  agent writer {
    model: sonnet
    tools: [Write]
  }

  agent reviewer {
    model: opus
    tools: [Read]
  }

  flow {
    researcher -> writer -> reviewer
    reviewer -> writer  [when reviewer.verdict == "revise", max 2]
  }

  observability {
    tracing: true
    spans: [agent, tool, flow]
    capture: [inputs, outputs, errors, timing, tokens]
    output: "traces/review-pipeline.json"
    format: json
  }
}

Tips

  • Enable tracing during development and disable it in production to save overhead, or use otlp format to send traces to a backend like Jaeger or Datadog.
  • Capturing inputs and outputs produces large trace files. Use selectively.
  • Combine with metering for a complete picture of both performance and cost.
  • The tool span type is especially useful for debugging MCP server issues.
  • Trace output paths are relative to the topology file's directory.

On this page