getTraceSummaries method

Future<GetTraceSummariesResult> getTraceSummaries({
  1. required DateTime endTime,
  2. required DateTime startTime,
  3. String? filterExpression,
  4. String? nextToken,
  5. bool? sampling,
  6. SamplingStrategy? samplingStrategy,
  7. TimeRangeType? timeRangeType,
})

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 Using Filter Expressions in the AWS X-Ray Developer Guide.

May throw InvalidRequestException. May throw ThrottledException.

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

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

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

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

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

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

Parameter timeRangeType : A parameter to indicate whether to query trace summaries by TraceId or Event time.

Implementation

Future<GetTraceSummariesResult> getTraceSummaries({
  required DateTime endTime,
  required DateTime startTime,
  String? filterExpression,
  String? nextToken,
  bool? sampling,
  SamplingStrategy? samplingStrategy,
  TimeRangeType? timeRangeType,
}) async {
  ArgumentError.checkNotNull(endTime, 'endTime');
  ArgumentError.checkNotNull(startTime, 'startTime');
  final $payload = <String, dynamic>{
    'EndTime': unixTimestampToJson(endTime),
    'StartTime': unixTimestampToJson(startTime),
    if (filterExpression != null) 'FilterExpression': filterExpression,
    if (nextToken != null) 'NextToken': nextToken,
    if (sampling != null) 'Sampling': sampling,
    if (samplingStrategy != null) 'SamplingStrategy': samplingStrategy,
    if (timeRangeType != null) 'TimeRangeType': timeRangeType.toValue(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/TraceSummaries',
    exceptionFnMap: _exceptionFns,
  );
  return GetTraceSummariesResult.fromJson(response);
}