traces
Creates, updates, deletes, gets or lists a traces resource.
Overview
| Name | traces |
| Type | Resource |
| Id | datadog.apm.traces |
Fields
The following fields are returned by SELECT queries:
- get_trace_by_id
| Name | Datatype | Description |
|---|---|---|
id | string | The full 128-bit trace ID, encoded as a 32-character hexadecimal string. (example: 0000000000000000abc1230000000000) |
attributes | object | The attributes of a trace returned by the Get trace by ID endpoint. |
type | string | The type of the trace resource. The value is always trace. (trace) (example: trace) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_trace_by_id | select | trace_id | include_fields | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
site | string | The 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_id | string | The 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_fields | array | List 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
- get_trace_by_id
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 }}'
;