v1

latestOpenAPI 3.0.02026-07-141,4077,1665.2 MB
LLM Observability

List LLM Observability spans

List LLM Observability spans matching the specified filters.

get/api/v2/llm-obs/v1/spans/events

Query parameters

filter[from]string
Example:now-900s

Start of the time range. Accepts ISO 8601 or relative format (e.g., now-15m). Defaults to now-15m.

filter[to]string
Example:now

End of the time range. Accepts ISO 8601 or relative format. Defaults to now.

filter[query]string
Example:@session_id:abc123def456

Search query using LLM Observability query syntax. Supports attribute filters using the field:value syntax (e.g. session_id, trace_id, ml_app, meta.span.kind). When provided, structured field filters (filter[span_id], filter[trace_id], etc.) are ignored.

filter[span_id]string

Filter by exact span ID.

filter[trace_id]string

Filter by exact trace ID.

filter[span_kind]string

Filter by span kind (e.g., llm, agent, tool, task, workflow).

filter[span_name]string

Filter by span name.

filter[ml_app]string

Filter by ML application name.

page[limit]integer

Maximum number of spans to return. Defaults to 10.

page[cursor]string

Cursor from the previous response to retrieve the next page.

sortstring

Sort order for the results.

include_attachmentsboolean

Whether to include attachment data in the response. Defaults to true.

Response

OK

Example response

{
  "data": [
    {
      "attributes": {
        "duration": 1500000000,
        "ml_app": "my-llm-app",
        "model_name": "gpt-4o",
        "model_provider": "openai",
        "name": "llm_call",
        "span_id": "abc123def456",
        "span_kind": "llm",
        "start_ns": 1705314600000000000,
        "status": "ok",
        "trace_id": "trace-9a8b7c6d5e4f"
      },
      "id": "abc123def456",
      "type": "span"
    }
  ],
  "links": {
    "next": "https://api.datadoghq.com/api/v2/llm-obs/v1/spans/events?page[cursor]=eyJzdGFydCI6MTAwfQ=="
  },
  "meta": {
    "elapsed": 132,
    "page": {
      "after": "eyJzdGFydCI6MTAwfQ=="
    },
    "request_id": "req-abc123",
    "status": "done"
  }
}