XRay / Client / list_retrieved_traces
list_retrieved_traces#
- XRay.Client.list_retrieved_traces(**kwargs)#
Retrieves a list of traces for a given
RetrievalToken
from the CloudWatch log group generated by Transaction Search. For information on what each trace returns, see BatchGetTraces.This API does not initiate a retrieval job. To start a trace retrieval, use
StartTraceRetrieval
, which generates the requiredRetrievalToken
.When the
RetrievalStatus
is not COMPLETE, the API will return an empty response. Retry the request once the retrieval has completed to access the full list of traces.For cross-account observability, this API can retrieve traces from linked accounts when CloudWatch log is the destination across relevant accounts. For more details, see CloudWatch cross-account observability.
For retrieving data from X-Ray directly as opposed to the Transaction-Search Log group, see BatchGetTraces.
See also: AWS API Documentation
Request Syntax
response = client.list_retrieved_traces( RetrievalToken='string', TraceFormat='XRAY'|'OTEL', NextToken='string' )
- Parameters:
RetrievalToken (string) –
[REQUIRED]
Retrieval token.
TraceFormat (string) – Format of the requested traces.
NextToken (string) – Specify the pagination token returned by a previous request to retrieve the next page of indexes.
- Return type:
dict
- Returns:
Response Syntax
{ 'RetrievalStatus': 'SCHEDULED'|'RUNNING'|'COMPLETE'|'FAILED'|'CANCELLED'|'TIMEOUT', 'TraceFormat': 'XRAY'|'OTEL', 'Traces': [ { 'Id': 'string', 'Duration': 123.0, 'Spans': [ { 'Id': 'string', 'Document': 'string' }, ] }, ], 'NextToken': 'string' }
Response Structure
(dict) –
RetrievalStatus (string) –
Status of the retrieval.
TraceFormat (string) –
Format of the requested traces.
Traces (list) –
Full traces for the specified requests.
(dict) –
Retrieved collection of spans with matching trace IDs.
Id (string) –
The unique identifier for the span.
Duration (float) –
The length of time in seconds between the start time of the root span and the end time of the last span that completed.
Spans (list) –
Spans that comprise the trace.
(dict) –
A span from a trace that has been ingested by the X-Ray service. A span represents a unit of work or an operation performed by a service.
Id (string) –
The span ID.
Document (string) –
The span document.
NextToken (string) –
Specify the pagination token returned by a previous request to retrieve the next page of indexes.
Exceptions
XRay.Client.exceptions.InvalidRequestException
XRay.Client.exceptions.ThrottledException
XRay.Client.exceptions.ResourceNotFoundException