Retrieve a Trace Item
Retrieve a span, log or other trace item of a project, with all of its attributes.
Pass the meta.routingHint of the events response that listed the item as
routing_hint, unchanged. An invalid hint returns 400.
Path Parameters
organization_id_or_slug(string)REQUIREDThe ID or slug of the organization the resource belongs to.
project_id_or_slug(string)REQUIREDThe ID or slug of the project the resource belongs to. Project slugs are unique within each organization.
item_id(string)REQUIREDThe hexadecimal ID of the item: the 16-character span ID for a span, or the 32-character item ID for other item types
Query Parameters:
trace_id(string)REQUIREDThe 32-character ID of the trace the item belongs to
item_type(string)REQUIRED- choices:
- attachments
- logs
- occurrences
- preprod
- processing_errors
- profile_functions
- spans
- tracemetrics
- uptime_results
The type of the item
routing_hint(string)The opaque
meta.routingHintof the events response that contained the item. Pass it unchanged to look the item up in the same storage. When it's omitted or empty, the default storage is usedtimestamp(string)When the item happened, as an ISO 8601 timestamp or Unix seconds. The lookup is narrowed to a few minutes around it, which makes it faster
statsPeriod(string)The period of time for the query, will override the start & end parameters, a number followed by one of:
dfor dayshfor hoursmfor minutessfor secondswfor weeks
For example,
24h, to mean query data starting from 24 hours ago to now.start(string)The start of the period of time for the query, expected in ISO-8601 format. For example,
2001-12-14T12:34:56.7890.end(string)The end of the period of time for the query, expected in ISO-8601 format. For example,
2001-12-14T12:34:56.7890.
Scopes
<auth_token> requires one of the following scopes:project:adminproject:readproject:write
curl https://sentry.io/api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/trace-items/{item_id}/ \ -H 'Authorization: Bearer <auth_token>'
Copied{ "itemId": "8873a98879faf06d", "timestamp": "2025-01-01T12:00:00Z", "attributes": [ { "name": "is_transaction", "type": "bool", "value": true }, { "name": "span.duration", "type": "float", "value": 132.5 }, { "name": "project_id", "type": "int", "value": "4505281256090153" }, { "name": "span.op", "type": "str", "value": "http.server" }, { "name": "transaction", "type": "str", "value": "GET /api/checkout/" } ], "meta": {}, "links": [ { "itemId": "e3c58cb0bd2d4c89", "traceId": "d099bf9ad5a143cf8f83a98081d0ed3b", "sampled": true, "attributes": [ { "name": "sentry.link.type", "value": "previous_trace", "type": "str" } ] } ] }