Telemetry

A3S Code exposes runtime evidence through events, traces, verification reports, and result metadata.

Result metadata

Rust
Node.js
Python
Go
Rust
let result = session.send("Run release checks", None).await?;
println!("{}", result.usage.prompt_tokens);
println!("{}", result.usage.completion_tokens);
println!("{}", result.usage.total_tokens);
println!("{}", result.tool_calls_count);
println!("{:?}", result.verification_summary().status);
println!("{}", result.verification_summary_text());

Traces and verification

Rust
Node.js
Python
Go
Rust
let trace = session.trace_events();
let reports = session.verification_reports();
let summary = session.verification_summary();
let text = session.verification_summary_text();

The Go methods cross the native bridge and therefore return an error; Rust, Node.js, and Python expose these in-process observation getters synchronously.

Streaming events

Streaming returns versioned AgentEvent envelopes. version, type, payload, and optional metadata are the stable lossless fields; text, tool names, tool output, errors, token totals, and verification summaries are convenience projections. Unknown future type values and their payloads remain available to hosts.

OpenTelemetry export

Rust hosts can export spans over OTLP by enabling the telemetry Cargo feature of a3s-code-core (included in the server and full profiles). The exporter lives in core/src/telemetry_otel.rs:

Rust
use a3s_code_core::telemetry_otel::TelemetryConfig;
let guard = TelemetryConfig::new("http://localhost:4317")
.with_service_name("my-agent")
.init()?;
// ... run sessions ...
guard.shutdown();

The default transport is gRPC; with_otlp_http() switches to OTLP/HTTP. Exports are bounded so an unreachable collector does not hold a coding turn or process shutdown. The Node.js, Python, and Go SDK crates do not declare a telemetry feature, so no published package includes the exporter; OTLP export is available only to Rust embedders. The opentelemetry entry returned by sdkCapabilities() is an advanced, host-owned capability that states this Core feature requirement.

Logging

For product telemetry, prefer structured trace events and verification reports over scraping console output.