Skip to main content

span_events

Creates, updates, deletes, gets or lists a span_events resource.

Overview

Namespan_events
TypeResource
Iddatadog.llm_observability.span_events

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringUnique identifier of the span. (example: abc123def456)
attributesobjectAttributes of an Agent Observability span.
typestringResource type for an Agent Observability span. (span) (example: span)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_llmobs_spansselectfilter[from], filter[to], filter[query], filter[span_id], filter[trace_id], filter[span_kind], filter[span_name], filter[ml_app], page[limit], page[cursor], sort, include_attachmentsList Agent Observability spans matching the specified filters.
search_llmobs_spansexecdataSearch Agent Observability spans using structured filters in the request body.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
sitestringThe Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both.
filter[from]stringStart of the time range. Accepts ISO 8601 or relative format (e.g., now-15m). Defaults to now-15m.
filter[ml_app]stringFilter by ML application name.
filter[query]stringSearch query using Agent 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]stringFilter by exact span ID.
filter[span_kind]stringFilter by span kind (e.g., llm, agent, tool, task, workflow).
filter[span_name]stringFilter by span name.
filter[to]stringEnd of the time range. Accepts ISO 8601 or relative format. Defaults to now.
filter[trace_id]stringFilter by exact trace ID.
include_attachmentsbooleanWhether to include attachment data in the response. Defaults to true.
page[cursor]stringCursor from the previous response to retrieve the next page.
page[limit]integer (int64)Maximum number of spans to return. Defaults to 10.
sortstringSort order for the results.

SELECT examples

List Agent Observability spans matching the specified filters.

SELECT
id,
attributes,
type
FROM datadog.llm_observability.span_events
WHERE filter[from] = '{{ filter[from] }}'
AND filter[to] = '{{ filter[to] }}'
AND filter[query] = '{{ filter[query] }}'
AND filter[span_id] = '{{ filter[span_id] }}'
AND filter[trace_id] = '{{ filter[trace_id] }}'
AND filter[span_kind] = '{{ filter[span_kind] }}'
AND filter[span_name] = '{{ filter[span_name] }}'
AND filter[ml_app] = '{{ filter[ml_app] }}'
AND page[limit] = '{{ page[limit] }}'
AND page[cursor] = '{{ page[cursor] }}'
AND sort = '{{ sort }}'
AND include_attachments = '{{ include_attachments }}'
;

Lifecycle Methods

EXEC variables use wire (API) names.

Search Agent Observability spans using structured filters in the request body.

EXEC datadog.llm_observability.span_events.search_llmobs_spans
@@json=
'{
"data": "{{ data }}"
}'
;