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 trueEach 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
| Detail | Description |
|---|---|
| Model name | Which model was used |
| Provider | openai, anthropic, etc. |
| Token counts | Input and output tokens |
| Cache status | Whether the response came from cache |
| Duration | How long the call took |
Mesh Call Details
| Detail | Description |
|---|---|
| Source agent | Which agent initiated the call |
| Target agent | Which agent was called |
| Call depth | How deep in the chain |
| Session | Which session the call belongs to |
Agent Execution Details
| Detail | Description |
|---|---|
| Agent name | Which agent ran |
| Agent type | llm, programmatic, human |
| Model | LLM 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
- Traceability API — REST API reference for querying traces, sessions, and spans
- Performance Metrics — Metrics collection
- Dashboard — Building dashboards
- Monitoring — Built-in monitoring
LeafMesh — Distributed tracing built in