Skip to main content

Telemetry and Tracing

Telemetry is enabled by default. Every agent records spans, LLM usage, and events automatically — no setup required. When connected to the mesh, telemetry exports to the Svantic dashboard. Otherwise, it exports to the console.

Zero-Config Telemetry

That’s it. Capability invocations are traced, LLM token usage is recorded, and everything exports to the Svantic dashboard automatically.

How it works

Disabling Telemetry

Set telemetry: false in the agent config:

Custom Spans

Use agent.tracer to add your own instrumentation. Spans automatically nest — starting a span while another is active makes it a child.

Span Types

Generic spans for any operation:
Tool spans with the tool name as an automatic attribute:
LLM spans that capture model and token usage:

Span Methods

Events

For discrete signals that are not part of the span tree (e.g. “document processed”, “ticket escalated”):
Events are buffered and flushed alongside spans. If emitted within an active span, they automatically capture the current trace_id and span_id for correlation.

W3C Trace Propagation

When your agent calls another agent (via RemoteAgent), trace context propagates automatically using the W3C traceparent header. This creates a unified trace across agent-to-agent calls.

Injecting context into outbound requests

For non-A2A HTTP calls (e.g. calling an external API), inject trace context manually:

Adopting inbound context

When your agent receives an HTTP request with a traceparent header, adopt the remote context so your spans join the caller’s trace:

Advanced: Custom Telemetry Instance

If you need full control over export destination, auth, or flush behavior, pass your own SvanticTelemetry instance:

Export destinations

Dashboard Integration

When telemetry exports to the Svantic mesh (the default for mesh-connected agents), your traces appear in the Svantic dashboard under the session timeline. You can:
  • See the full span tree for each capability invocation.
  • View LLM token usage per call.
  • Trace requests across agent-to-agent boundaries.
  • Correlate events with the spans that produced them.

Shutdown

Telemetry flushes automatically on shutdown:
agent.stop() (and agent.close()) calls telemetry.shutdown() internally, which stops the flush timer, flushes remaining data, and shuts down the exporter.