End-to-End Flow
Agent emits spans
The SDK’s framework instrumentor captures every LLM call, tool invocation, and agent action as an OpenTelemetry span. The
TraceCtrlSpanProcessor enriches each span with security attributes.Spans exported via OTLP
The
BatchSpanProcessor batches spans and exports them via OTLP gRPC to the OTel Collector at :4317.Collector routes to ClickHouse
The OTel Collector receives spans and exports them to ClickHouse via the
clickhouseexporter. Spans land in the otel_traces table with SpanAttributes stored as a Map(String, String).Engine pipeline processes spans
Every 60 seconds, the engine reads new spans since the last watermark, builds the agent inventory, and constructs topology edges.
Verifying Each Stage
1. Are spans being exported?
SetTRACECTRL_FAIL_SILENTLY=false temporarily to see exporter errors:
2. Is the Collector receiving spans?
3. Are spans in ClickHouse?
4. Is the pipeline running?
5. Does the API return data?
Latency
| Stage | Typical Latency |
|---|---|
| SDK span processing | < 1ms per span |
| Batch export to Collector | 1 second (configurable via TRACECTRL_BATCH_DELAY_MS) |
| Collector → ClickHouse | < 100ms |
| Pipeline processing | 60 second cycle (configurable) |
| API response | < 50ms |

