Skip to main content

traces

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

Overview

Nametraces
TypeResource
Iddatadog.apm.traces

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe full 128-bit trace ID, encoded as a 32-character hexadecimal string. (example: 0000000000000000abc1230000000000)
attributesobjectThe attributes of a trace returned by the Get trace by ID endpoint.
typestringThe type of the trace resource. The value is always trace. (trace) (example: trace)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_trace_by_idselecttrace_idinclude_fieldsRetrieve a full APM trace by its trace ID, including every span in the trace.<br />Traces are returned from live storage when available and fall back to longer-term storage.<br />This endpoint is rate limited to 60 requests per minute per organization.

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.
trace_idstringThe trace ID. Accepts either a 32-character hexadecimal string (128-bit trace ID) or a decimal string of up to 39 digits. (example: 0000000000000000abc1230000000000)
include_fieldsarrayList of span fields to include in the response. When omitted, every available field is returned. Values may be passed as repeated query parameters or as a single comma-separated value. (example: [service, resource_name])

SELECT examples

Retrieve a full APM trace by its trace ID, including every span in the trace.<br />Traces are returned from live storage when available and fall back to longer-term storage.<br />This endpoint is rate limited to 60 requests per minute per organization.

SELECT
id,
attributes,
type
FROM datadog.apm.traces
WHERE trace_id = '{{ trace_id }}' -- required
AND include_fields = '{{ include_fields }}'
;