Skip to content
Get started

Get a trace and all its spans

traces.retrieve(strtrace_id) -> TraceRetrieveResponse
GET/api/traces/{trace_id}/

Looked up by trace_id (the OTel 32-char hex), not by row id. Returns the root span plus every span sharing that trace_id.

ParametersExpand Collapse
trace_id: str
ReturnsExpand Collapse
class TraceRetrieveResponse:

GET /api/traces/{trace_id}/ payload — root summary + every span.

root: Optional[Root]

Full span — used both for /api/traces/{trace_id}/ (one span row in the per-trace list) and as the per-row representation for any span query.

agent: Optional[str]
formatuuid
attributes: object
duration_ns: int
end_time_ns: int
events: object
is_root: bool
iteration: Optional[str]
formatuuid
job: Optional[str]
formatuuid
kind: int
name: str
operation: str
parent_span_id: Optional[str]
project: str
formatuuid
received_at: datetime
formatdate-time
resource_attrs: object
scope_name: str
scope_version: str
service_name: str
span_id: str
span_type: Literal["llm_call", "tool_call"]
  • llm_call - Llm Call
  • tool_call - Tool Call
Accepts one of the following:
"llm_call"
"tool_call"
start_time_ns: int
status_code: int
status_message: str
trace_id: str
span_count: int
spans: List[Span]
agent: Optional[str]
formatuuid
attributes: object
duration_ns: int
end_time_ns: int
events: object
is_root: bool
iteration: Optional[str]
formatuuid
job: Optional[str]
formatuuid
kind: int
name: str
operation: str
parent_span_id: Optional[str]
project: str
formatuuid
received_at: datetime
formatdate-time
resource_attrs: object
scope_name: str
scope_version: str
service_name: str
span_id: str
span_type: Literal["llm_call", "tool_call"]
  • llm_call - Llm Call
  • tool_call - Tool Call
Accepts one of the following:
"llm_call"
"tool_call"
start_time_ns: int
status_code: int
status_message: str
trace_id: str
trace_id: str
Get a trace and all its spans
from overmind_lab import OvermindLab

client = OvermindLab()
trace = client.traces.retrieve(
    "trace_id",
)
print(trace.trace_id)
{
  "root": {
    "agent": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "attributes": {},
    "duration_ns": 0,
    "end_time_ns": 0,
    "events": {},
    "is_root": true,
    "iteration": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "job": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "kind": 0,
    "links": {},
    "name": "name",
    "operation": "operation",
    "parent_span_id": "parent_span_id",
    "project": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "received_at": "2019-12-27T18:11:19.117Z",
    "resource_attrs": {},
    "scope_name": "scope_name",
    "scope_version": "scope_version",
    "service_name": "service_name",
    "span_id": "span_id",
    "span_type": "llm_call",
    "start_time_ns": 0,
    "status_code": 0,
    "status_message": "status_message",
    "trace_id": "trace_id"
  },
  "span_count": 0,
  "spans": [
    {
      "agent": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "attributes": {},
      "duration_ns": 0,
      "end_time_ns": 0,
      "events": {},
      "is_root": true,
      "iteration": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "job": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "kind": 0,
      "links": {},
      "name": "name",
      "operation": "operation",
      "parent_span_id": "parent_span_id",
      "project": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "received_at": "2019-12-27T18:11:19.117Z",
      "resource_attrs": {},
      "scope_name": "scope_name",
      "scope_version": "scope_version",
      "service_name": "service_name",
      "span_id": "span_id",
      "span_type": "llm_call",
      "start_time_ns": 0,
      "status_code": 0,
      "status_message": "status_message",
      "trace_id": "trace_id"
    }
  ],
  "trace_id": "trace_id"
}
Returns Examples
{
  "root": {
    "agent": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "attributes": {},
    "duration_ns": 0,
    "end_time_ns": 0,
    "events": {},
    "is_root": true,
    "iteration": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "job": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "kind": 0,
    "links": {},
    "name": "name",
    "operation": "operation",
    "parent_span_id": "parent_span_id",
    "project": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "received_at": "2019-12-27T18:11:19.117Z",
    "resource_attrs": {},
    "scope_name": "scope_name",
    "scope_version": "scope_version",
    "service_name": "service_name",
    "span_id": "span_id",
    "span_type": "llm_call",
    "start_time_ns": 0,
    "status_code": 0,
    "status_message": "status_message",
    "trace_id": "trace_id"
  },
  "span_count": 0,
  "spans": [
    {
      "agent": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "attributes": {},
      "duration_ns": 0,
      "end_time_ns": 0,
      "events": {},
      "is_root": true,
      "iteration": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "job": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "kind": 0,
      "links": {},
      "name": "name",
      "operation": "operation",
      "parent_span_id": "parent_span_id",
      "project": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "received_at": "2019-12-27T18:11:19.117Z",
      "resource_attrs": {},
      "scope_name": "scope_name",
      "scope_version": "scope_version",
      "service_name": "service_name",
      "span_id": "span_id",
      "span_type": "llm_call",
      "start_time_ns": 0,
      "status_code": 0,
      "status_message": "status_message",
      "trace_id": "trace_id"
    }
  ],
  "trace_id": "trace_id"
}