Menu
AWS X-Ray
API Reference (API Version 2016-04-12)

GetTraceSummaries

Retrieves IDs and metadata 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.

Request Syntax

Copy
POST /TraceSummaries HTTP/1.1 Content-type: application/json { "EndTime": number, "FilterExpression": "string", "NextToken": "string", "Sampling": boolean, "StartTime": number }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

EndTime

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

Type: Timestamp

Required: Yes

FilterExpression

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

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2000.

Required: No

NextToken

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

Type: String

Required: No

Sampling

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

Type: Boolean

Required: No

StartTime

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

Type: Timestamp

Required: Yes

Response Syntax

Copy
HTTP/1.1 200 Content-type: application/json { "ApproximateTime": number, "NextToken": "string", "TracesProcessedCount": number, "TraceSummaries": [ { "Annotations": { "string" : [ { "AnnotationValue": { "BooleanValue": boolean, "NumberValue": number, "StringValue": "string" }, "ServiceIds": [ { "AccountId": "string", "Name": "string", "Names": [ "string" ], "Type": "string" } ] } ] }, "Duration": number, "HasError": boolean, "HasFault": boolean, "HasThrottle": boolean, "Http": { "ClientIp": "string", "HttpMethod": "string", "HttpStatus": number, "HttpURL": "string", "UserAgent": "string" }, "Id": "string", "IsPartial": boolean, "ResponseTime": number, "ServiceIds": [ { "AccountId": "string", "Name": "string", "Names": [ "string" ], "Type": "string" } ], "Users": [ { "ServiceIds": [ { "AccountId": "string", "Name": "string", "Names": [ "string" ], "Type": "string" } ], "UserName": "string" } ] } ] }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

ApproximateTime

The start time of this page of results.

Type: Timestamp

NextToken

If the requested time frame contained more than one page of results, you can use this token to retrieve the next page. The first page contains the most most recent results, closest to the end of the time frame.

Type: String

TracesProcessedCount

The number of traces that were processed to get this set of summaries.

Type: Long

TraceSummaries

Trace IDs and metadata for traces that were found in the specified time frame.

Type: Array of TraceSummary objects

Errors

For information about the errors that are common to all actions, see Common Errors.

InvalidRequestException

The request is missing required parameters or has invalid parameters.

HTTP Status Code: 400

ThrottledException

The request exceeds the maximum number of requests per second.

HTTP Status Code: 429

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: