Skip to content

list_retrieved_traces

list_retrieved_traces(
    retrieval_token: RetrievalToken,
    *,
    config_overrides: Optional[XRayClientConfig] = None,
    trace_format: Optional[TraceFormatType] = None,
    next_token: Optional[String] = None,
) -> ListRetrievedTracesResult

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.

Parameters:

  • retrieval_token (RetrievalToken) –

    Retrieval token.

  • trace_format (Optional[TraceFormatType], default: None ) –

    Format of the requested traces.

  • next_token (Optional[String], default: None ) –

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

Raises:

Source code in docs_src/capo_xray/_services/x_ray.py
def list_retrieved_traces(
    self,
    retrieval_token: "capo_xray.types.retrieval_token.RetrievalToken",
    *,
    config_overrides: Optional[XRayClientConfig] = None,
    trace_format: Optional[
        "capo_xray.types.trace_format_type.TraceFormatType"
    ] = None,
    next_token: Optional["capo_xray.types.string.String"] = None,
) -> "capo_xray.types.list_retrieved_traces_result.ListRetrievedTracesResult":
    """<p> Retrieves a list of traces for a given <code>RetrievalToken</code> from the CloudWatch log group generated by Transaction Search. For information on what each trace returns, see <a href="https://docs.aws.amazon.com/xray/latest/api/API_BatchGetTraces.html">BatchGetTraces</a>. </p> <p>This API does not initiate a retrieval process. To start a trace retrieval, use <code>StartTraceRetrieval</code>, which generates the required <code>RetrievalToken</code>.</p> <p> When the <code>RetrievalStatus</code> is not <i>COMPLETE</i>, the API will return an empty response. Retry the request once the retrieval has completed to access the full list of traces.</p> <p>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 <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html">CloudWatch cross-account observability</a>.</p> <p>For retrieving data from X-Ray directly as opposed to the Transaction Search generated log group, see <a href="https://docs.aws.amazon.com/xray/latest/api/API_BatchGetTraces.html">BatchGetTraces</a>.</p>

    Args:
        retrieval_token: <p> Retrieval token. </p>
        trace_format: <p> Format of the requested traces. </p>
        next_token: <p> Specify the pagination token returned by a previous request to retrieve the next page of indexes. </p>

    Raises:
        capo_xray.errors.invalid_request_exception.InvalidRequestException: <p>The request is missing required parameters or has invalid parameters.</p>
        capo_xray.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource was not found. Verify that the name or Amazon Resource Name (ARN) of the resource is correct.</p>
        capo_xray.errors.throttled_exception.ThrottledException: <p>The request exceeds the maximum number of requests per second.</p>
        capo_xray.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_xray.types.list_retrieved_traces_request.ListRetrievedTracesRequest]",
    ) -> OperationResponse[
        "capo_xray.types.list_retrieved_traces_result.ListRetrievedTracesResult"
    ]:
        import capo_xray._operations.awsx_ray.list_retrieved_traces

        output, http_response = (
            capo_xray._operations.awsx_ray.list_retrieved_traces.list_retrieved_traces(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListRetrievedTraces")
    )
    input_: capo_xray.types.list_retrieved_traces_request.ListRetrievedTracesRequest = {
        "retrieval_token": retrieval_token
    }
    if trace_format is not None:
        input_["trace_format"] = trace_format
    if next_token is not None:
        input_["next_token"] = next_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output