Skip to content

get_trace_summaries async

get_trace_summaries(
    start_time: Timestamp,
    end_time: Timestamp,
    *,
    config_overrides: Optional[AsyncXRayClientConfig] = None,
    time_range_type: Optional[TimeRangeType] = None,
    sampling: Optional[NullableBoolean] = None,
    sampling_strategy: Optional[SamplingStrategy] = None,
    filter_expression: Optional[FilterExpression] = None,
    next_token: Optional[String] = None,
) -> GetTraceSummariesResult

Retrieves IDs and annotations for traces available for a specified time frame using an optional filter. To get the full traces, pass the trace IDs to BatchGetTraces.

A filter expression can target traced requests that hit specific service nodes or edges, have errors, or come from a known user. For example, the following filter expression targets traces that pass through api.example.com:

service("api.example.com")

This filter expression finds traces that have an annotation named account with the value 12345:

annotation.account = "12345"

For a full list of indexed fields and keywords that you can use in filter expressions, see Use filter expressions in the Amazon Web Services X-Ray Developer Guide.

Parameters:

  • start_time (Timestamp) –

    The start of the time frame for which to retrieve traces.

  • end_time (Timestamp) –

    The end of the time frame for which to retrieve traces.

  • time_range_type (Optional[TimeRangeType], default: None ) –

    Query trace summaries by TraceId (trace start time), Event (trace update time), or Service (trace segment end time).

  • sampling (Optional[NullableBoolean], default: None ) –

    Set to true to get summaries for only a subset of available traces.

  • sampling_strategy (Optional[SamplingStrategy], default: None ) –

    A parameter to indicate whether to enable sampling on trace summaries. Input parameters are Name and Value.

  • filter_expression (Optional[FilterExpression], default: None ) –

    Specify a filter expression to retrieve trace summaries for services or requests that meet certain requirements.

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

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

Raises:

Source code in docs_src/capo_xray/_services/async_x_ray.py
async def get_trace_summaries(
    self,
    start_time: "capo_xray.types.timestamp.Timestamp",
    end_time: "capo_xray.types.timestamp.Timestamp",
    *,
    config_overrides: Optional[AsyncXRayClientConfig] = None,
    time_range_type: Optional[
        "capo_xray.types.time_range_type.TimeRangeType"
    ] = None,
    sampling: Optional["capo_xray.types.nullable_boolean.NullableBoolean"] = None,
    sampling_strategy: Optional[
        "capo_xray.types.sampling_strategy.SamplingStrategy"
    ] = None,
    filter_expression: Optional[
        "capo_xray.types.filter_expression.FilterExpression"
    ] = None,
    next_token: Optional["capo_xray.types.string.String"] = None,
) -> "capo_xray.types.get_trace_summaries_result.GetTraceSummariesResult":
    """<p>Retrieves IDs and annotations for traces available for a specified time frame using an optional filter. To get the full traces, pass the trace IDs to <code>BatchGetTraces</code>.</p> <p>A filter expression can target traced requests that hit specific service nodes or edges, have errors, or come from a known user. For example, the following filter expression targets traces that pass through <code>api.example.com</code>:</p> <p> <code>service("api.example.com")</code> </p> <p>This filter expression finds traces that have an annotation named <code>account</code> with the value <code>12345</code>:</p> <p> <code>annotation.account = "12345"</code> </p> <p>For a full list of indexed fields and keywords that you can use in filter expressions, see <a href="https://docs.aws.amazon.com/xray/latest/devguide/aws-xray-interface-console.html#xray-console-filters">Use filter expressions</a> in the <i>Amazon Web Services X-Ray Developer Guide</i>.</p>

    Args:
        start_time: <p>The start of the time frame for which to retrieve traces.</p>
        end_time: <p>The end of the time frame for which to retrieve traces.</p>
        time_range_type: <p>Query trace summaries by TraceId (trace start time), Event (trace update time), or Service (trace segment end time).</p>
        sampling: <p>Set to <code>true</code> to get summaries for only a subset of available traces.</p>
        sampling_strategy: <p>A parameter to indicate whether to enable sampling on trace summaries. Input parameters are Name and Value.</p>
        filter_expression: <p>Specify a filter expression to retrieve trace summaries for services or requests that meet certain requirements.</p>
        next_token: <p>Specify the pagination token returned by a previous request to retrieve the next page of results.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_xray.types.get_trace_summaries_request.GetTraceSummariesRequest]",
    ) -> AsyncOperationResponse[
        "capo_xray.types.get_trace_summaries_result.GetTraceSummariesResult"
    ]:
        import capo_xray._operations.awsx_ray.get_trace_summaries

        (
            output,
            http_response,
        ) = await capo_xray._operations.awsx_ray.get_trace_summaries.async_get_trace_summaries(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetTraceSummaries")
    )
    input_: capo_xray.types.get_trace_summaries_request.GetTraceSummariesRequest = {
        "start_time": start_time,
        "end_time": end_time,
    }
    if time_range_type is not None:
        input_["time_range_type"] = time_range_type
    if sampling is not None:
        input_["sampling"] = sampling
    if sampling_strategy is not None:
        input_["sampling_strategy"] = sampling_strategy
    if filter_expression is not None:
        input_["filter_expression"] = filter_expression
    if next_token is not None:
        input_["next_token"] = next_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output