1. Add traces
Install the SDK and callinit() once at startup. Wrap each user↔agent exchange in a turn():
turn() opens a span and makes it the active span — any auto-instrumented LLM or tool call
inside nests underneath it automatically. t.reply() records the assistant response as the transcript.
2. Connect simulation
When Eldros runs a test scenario it sends W3Ctraceparent + baggage headers on every request.
Continue them with one line around your handler:
trace_context works with FastAPI, Flask, Starlette, A2A, JSON-RPC — any HTTP framework.
On production requests (no Eldros headers) it is a no-op, so you keep one handler for both.
When the headers are present, every span is stamped with:
episode.id— links the trace to the specific test runtraffic_type="simulation"— keeps test traffic out of your production views
For simulation,
t.reply() is optional — Eldros already has the transcript from the
platform side. turn() is still required so each LLM/tool span is linked to the correct
turn, giving you a structured trace even without the client-side transcript.3. Integration modes
Pick the mode that matches what you need: Simulation + production observability (recommended)Full transcript and traces for both production and eval runs:
Only export during Eldros-driven test runs. Production traffic goes through normally but nothing is sent to the backend.
t.reply() optional — platform has the transcript:
No simulation integration. Full transcript required since there is no platform-side record:
Traces without
turn() — in any mode — cannot be correlated to specific conversation
turns. The transcript is what gets judged; traces explain the verdict.A2A agents
A2A is JSON-RPC over HTTP — the same pattern applies. Use the officiala2a-sdk and
place trace_context inside your AgentExecutor.execute():
init(), simulation_only, the three integration modes — is identical
to the HTTP section above.