listRetrievedTraces method

Future<ListRetrievedTracesResult> listRetrievedTraces({
  1. required String retrievalToken,
  2. String? nextToken,
  3. TraceFormatType? traceFormat,
})

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 process. To start a trace retrieval, use StartTraceRetrieval, which generates the required RetrievalToken.

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 set as 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 generated log group, see BatchGetTraces.

May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottledException.

Parameter retrievalToken : Retrieval token.

Parameter nextToken : Specify the pagination token returned by a previous request to retrieve the next page of indexes.

Parameter traceFormat : Format of the requested traces.

Implementation

Future<ListRetrievedTracesResult> listRetrievedTraces({
  required String retrievalToken,
  String? nextToken,
  TraceFormatType? traceFormat,
}) async {
  final $payload = <String, dynamic>{
    'RetrievalToken': retrievalToken,
    if (nextToken != null) 'NextToken': nextToken,
    if (traceFormat != null) 'TraceFormat': traceFormat.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/ListRetrievedTraces',
    exceptionFnMap: _exceptionFns,
  );
  return ListRetrievedTracesResult.fromJson(response);
}