Distributed Tracing

Distributed Tracing

LeafMesh automatically traces requests across agents, giving you full visibility into multi-agent workflows.

Overview

LeafMesh automatically instruments:

  • LLM calls: Model, token counts, latency, cache hit/miss
  • Mesh communications: From/to agents, payload size, duration
  • Session operations: Create, resume, end lifecycle
  • Tool executions: Tool name, duration, success/failure

No setup is required — tracing activates automatically when your license key is set.

Content Redaction (on by default)

Since 2.4.480 the customer's content is hidden in traces by default:

security: telemetry_redact_pii: true # default true

Each content value — what an agent received and what it sent back: prompts, user messages, tool inputs and outputs, model completions — is replaced whole with <redacted bytes:N>, where N is its size. This is not per-word PII detection; the whole value is replaced. Names, models, token counts, cost, status, errors and timings stay visible, so dashboards and call-graph analysis keep working.

Set security.telemetry_redact_pii: false to keep content readable, for example when traces go only to a backend you run and your compliance obligations allow it. Teams working under SOC 2 / ISO 27001 / GDPR obligations that cover trace storage typically leave it true in every environment.

Always on, whatever the switch says:

  • Credentials (keys, tokens and registered secret values) are always masked.
  • LeafCraft's own platform prompts appear as <platform_prompt:N chars>, and raw Manager replies as <elided:N chars>.
  • On a Manager-work span, the customer's material is replaced field by field (when redaction is on), while the marker for LeafCraft's instructions stays.

The setting is part of the agency's configuration, so it is versioned with the agency, visible in Agent Studio, and behaves the same wherever your traces are sent.

Trace Structure

A typical multi-agent request generates a trace like:

mesh_call (root)
├── agent: triage
│   └── llm: gpt-4o-mini, tokens=150
├── mesh: triage → specialist
├── agent: specialist
│   ├── precompose: enrich_context
│   ├── llm: gpt-4o, tokens=800
│   ├── tool: web_request
│   └── llm: gpt-4o, tokens=400 (follow-up after tool)

What You Can See in Traces

LLM Call Details

DetailDescription
Model nameWhich model was used
Provideropenai, anthropic, etc.
Token countsInput and output tokens
Cache statusWhether the response came from cache
DurationHow long the call took

Mesh Call Details

DetailDescription
Source agentWhich agent initiated the call
Target agentWhich agent was called
Call depthHow deep in the chain
SessionWhich session the call belongs to

Agent Execution Details

DetailDescription
Agent nameWhich agent ran
Agent typellm, programmatic, human
ModelLLM model used (if applicable)

Correlation

Traces correlate with business data through session IDs:

  • Trace: Shows timing and flow of a request
  • Session data: Shows the actual data at each step (browse in the Studio Sessions tab)

Use the trace to find slow steps, then jump to session data for the business context of that step.

Next Steps


LeafMesh — Distributed tracing built in

Last updated: 11/10/2026