Skip to content

batch_get_traces

batch_get_traces(
    trace_ids: TraceIdList,
    *,
    config_overrides: Optional[XRayClientConfig] = None,
    next_token: Optional[String] = None,
) -> BatchGetTracesResult

You cannot find traces through this API if Transaction Search is enabled since trace is not indexed in X-Ray.

Retrieves a list of traces specified by ID. Each trace is a collection of segment documents that originates from a single request. Use GetTraceSummaries to get a list of trace IDs.

Parameters:

  • trace_ids (TraceIdList) –

    Specify the trace IDs of requests for which to retrieve segments.

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

    Pagination token.

Raises:

Source code in docs_src/capo_xray/_services/x_ray.py
def batch_get_traces(
    self,
    trace_ids: "capo_xray.types.trace_id_list.TraceIdList",
    *,
    config_overrides: Optional[XRayClientConfig] = None,
    next_token: Optional["capo_xray.types.string.String"] = None,
) -> "capo_xray.types.batch_get_traces_result.BatchGetTracesResult":
    """<note> <p>You cannot find traces through this API if Transaction Search is enabled since trace is not indexed in X-Ray.</p> </note> <p>Retrieves a list of traces specified by ID. Each trace is a collection of segment documents that originates from a single request. Use <code>GetTraceSummaries</code> to get a list of trace IDs.</p>

    Args:
        trace_ids: <p>Specify the trace IDs of requests for which to retrieve segments.</p>
        next_token: <p>Pagination token.</p>

    Raises:
        capo_xray.errors.invalid_request_exception.InvalidRequestException: <p>The request is missing required parameters or has invalid parameters.</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.batch_get_traces_request.BatchGetTracesRequest]",
    ) -> OperationResponse[
        "capo_xray.types.batch_get_traces_result.BatchGetTracesResult"
    ]:
        import capo_xray._operations.awsx_ray.batch_get_traces

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("BatchGetTraces")
    )
    input_: capo_xray.types.batch_get_traces_request.BatchGetTracesRequest = {
        "trace_ids": trace_ids
    }
    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