What you get
Who called whom inside one trace is each span’s
parent_id, as in any trace.
Two rules apply to all of them:
- A span’s agent is its own. A span that names no agent belongs to the nearest span above it that does. Nothing is copied down the tree, so the agent filters return only the spans that name the agent.
- What you send wins. A key you set yourself, such as
__agent_name__, is stored as sent and never overwritten.
What to send
Over OpenTelemetry
When spans arrive at the OpenTelemetry endpoint, SGP derives each field from the attributes agent frameworks already send. To emit them yourself, set:Through the SGP SDK or the Agentex SDK
Spans written through the SGP SDK or the Agentex SDK are stored as sent. Nothing is derived, so set the fields yourself:__agent_name__ on every span from the agent’s manifest, and __agent_id__
when the AGENT_ID environment variable is set. It sends no session, handoff, or parent run.
What each framework sends
Each OpenTelemetry row reflects a recorded run of that framework. A framework that is not listed works the same way when it sends the attributes above.Query it
In the UI
- On the Traces page, the Session ID filter lists one row per trace of a session. The Agent Name and Agent ID filters match the spans that name an agent, so use the All Spans scope to find an agent that did not start the trace.
- In the Trace Detail View, each span that names an agent shows an agent badge, and the span details panel shows the span’s session with a shortcut that filters the Traces page to it.
Through the API
Send these request bodies to Search Spans (POST /v5/spans/search):
With
parents_only, a session search returns the root span of each trace that holds a completed
span of the session inside the time window, whether or not the root carries the session itself.
The time window and the other filters still apply to that root.
<start> and <end> are ISO 8601 timestamps.
Span metrics and
Export Spans take the same filters and resolve the same traces.
An export with with_children set to true carries every span of those traces.
To read a whole run, call
List span summaries for a trace
(GET /v5/traces/{trace_id}/spans). Each summary carries parent_id, group_id, and the
agent_name and agent_id its span ran as. A summary whose span names no agent has both set to
null, so walk up parent_id to the nearest span that names one.