OpenTelemetry
Once an agent runs in production, you need to see inside it: how long turns take, which tools are called, where errors cluster, and how cost trends over time. The Syntic Agent SDK integrates with OpenTelemetry, the vendor-neutral standard for traces and metrics, so Amara’s activity flows into whatever observability backend you already run — whether that is a hosted APM, a self-managed collector, or a local console exporter during development.
Emitting traces
Enable telemetry through the query options and point the SDK at your collector. Each turn becomes a trace, and each tool call becomes a child span, so you can see the full causal tree of a run and drill into the slow or failing parts.
import { query } from "@syntic/agent-sdk";
for await (const message of query({
prompt: "Run the test suite and fix failures.",
options: {
telemetry: {
enabled: true,
serviceName: "syntic-agent",
endpoint: process.env.OTEL_EXPORTER_OTLP_ENDPOINT,
},
},
})) {
// ...
}Metrics worth tracking
Beyond traces, the SDK can export metrics that summarize behavior across many runs. The ones teams watch most closely are turn latency, tool-call counts by tool, token consumption, and error rate. Wire these into dashboards and alerts so you learn about regressions from your monitoring rather than from users.
async for message in query(
prompt="Audit dependencies.",
options={
"telemetry": {
"enabled": True,
"service_name": "syntic-agent",
"endpoint": "http://localhost:4317",
}
},
):
...Correlating with your app
Because the SDK follows OpenTelemetry context propagation, agent spans nest inside the request spans of your own service. If a user action in your product triggers an agent run, the resulting trace shows your HTTP handler, the agent turns, and every tool call as one connected story. Attach your own attributes — tenant, feature flag, request ID — to make traces searchable and to tie observability back to the cost data on each result.