AWS X-Ray

2018/11/20 - AWS X-Ray - 5 new 1 updated api methods

Changes  Groups build upon X-Ray filter expressions to allow for fine tuning trace summaries and service graph results. You can configure groups by using the AWS X-Ray console or by using the CreateGroup API. The addition of groups has extended the available request fields to the GetServiceGraph API. You can now specify a group name or group ARN to retrieve its service graph.

CreateGroup (new) Link ¶

Creates a group resource with a name and a filter expression.

See also: AWS API Documentation

Request Syntax

client.create_group(
    GroupName='string',
    FilterExpression='string'
)
type GroupName

string

param GroupName

[REQUIRED]

The case-sensitive name of the new group. Default is a reserved name and names must be unique.

type FilterExpression

string

param FilterExpression

The filter expression defining criteria by which to group traces.

rtype

dict

returns

Response Syntax

{
    'Group': {
        'GroupName': 'string',
        'GroupARN': 'string',
        'FilterExpression': 'string'
    }
}

Response Structure

  • (dict) --

    • Group (dict) --

      The group that was created. Contains the name of the group that was created, the ARN of the group that was generated based on the group name, and the filter expression that was assigned to the group.

      • GroupName (string) --

        The unique case-sensitive name of the group.

      • GroupARN (string) --

        The ARN of the group generated based on the GroupName.

      • FilterExpression (string) --

        The filter expression defining the parameters to include traces.

GetGroup (new) Link ¶

Retrieves group resource details.

See also: AWS API Documentation

Request Syntax

client.get_group(
    GroupName='string',
    GroupARN='string'
)
type GroupName

string

param GroupName

The case-sensitive name of the group.

type GroupARN

string

param GroupARN

The ARN of the group that was generated on creation.

rtype

dict

returns

Response Syntax

{
    'Group': {
        'GroupName': 'string',
        'GroupARN': 'string',
        'FilterExpression': 'string'
    }
}

Response Structure

  • (dict) --

    • Group (dict) --

      The group that was requested. Contains the name of the group, the ARN of the group, and the filter expression that assigned to the group.

      • GroupName (string) --

        The unique case-sensitive name of the group.

      • GroupARN (string) --

        The ARN of the group generated based on the GroupName.

      • FilterExpression (string) --

        The filter expression defining the parameters to include traces.

DeleteGroup (new) Link ¶

Deletes a group resource.

See also: AWS API Documentation

Request Syntax

client.delete_group(
    GroupName='string',
    GroupARN='string'
)
type GroupName

string

param GroupName

The case-sensitive name of the group.

type GroupARN

string

param GroupARN

The ARN of the group that was generated on creation.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

GetGroups (new) Link ¶

Retrieves all active group details.

See also: AWS API Documentation

Request Syntax

client.get_groups(
    NextToken='string'
)
type NextToken

string

param NextToken

Pagination token. Not used.

rtype

dict

returns

Response Syntax

{
    'Groups': [
        {
            'GroupName': 'string',
            'GroupARN': 'string',
            'FilterExpression': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Groups (list) --

      The collection of all active groups.

      • (dict) --

        Details for a group without metadata.

        • GroupName (string) --

          The unique case-sensitive name of the group.

        • GroupARN (string) --

          The ARN of the group generated based on the GroupName.

        • FilterExpression (string) --

          The filter expression defining the parameters to include traces.

    • NextToken (string) --

      Pagination token. Not used.

UpdateGroup (new) Link ¶

Updates a group resource.

See also: AWS API Documentation

Request Syntax

client.update_group(
    GroupName='string',
    GroupARN='string',
    FilterExpression='string'
)
type GroupName

string

param GroupName

The case-sensitive name of the group.

type GroupARN

string

param GroupARN

The ARN that was generated upon create.

type FilterExpression

string

param FilterExpression

The updated filter expression defining criteria by which to group traces.

rtype

dict

returns

Response Syntax

{
    'Group': {
        'GroupName': 'string',
        'GroupARN': 'string',
        'FilterExpression': 'string'
    }
}

Response Structure

  • (dict) --

    • Group (dict) --

      The group that was updated. Contains the name of the group that was updated, the ARN of the group that was updated, and the updated filter expression assigned to the group.

      • GroupName (string) --

        The unique case-sensitive name of the group.

      • GroupARN (string) --

        The ARN of the group generated based on the GroupName.

      • FilterExpression (string) --

        The filter expression defining the parameters to include traces.

GetServiceGraph (updated) Link ¶
Changes (request, response)
Request
{'GroupARN': 'string', 'GroupName': 'string'}
Response
{'ContainsOldGroupVersions': 'boolean'}

Retrieves a document that describes services that process incoming requests, and downstream services that they call as a result. Root services process incoming requests and make calls to downstream services. Root services are applications that use the AWS X-Ray SDK. Downstream services can be other applications, AWS resources, HTTP web APIs, or SQL databases.

See also: AWS API Documentation

Request Syntax

client.get_service_graph(
    StartTime=datetime(2015, 1, 1),
    EndTime=datetime(2015, 1, 1),
    GroupName='string',
    GroupARN='string',
    NextToken='string'
)
type StartTime

datetime

param StartTime

[REQUIRED]

The start of the time frame for which to generate a graph.

type EndTime

datetime

param EndTime

[REQUIRED]

The end of the time frame for which to generate a graph.

type GroupName

string

param GroupName

The name of a group to generate a graph based on.

type GroupARN

string

param GroupARN

The ARN of a group to generate a graph based on.

type NextToken

string

param NextToken

Pagination token. Not used.

rtype

dict

returns

Response Syntax

{
    'StartTime': datetime(2015, 1, 1),
    'EndTime': datetime(2015, 1, 1),
    'Services': [
        {
            'ReferenceId': 123,
            'Name': 'string',
            'Names': [
                'string',
            ],
            'Root': True|False,
            'AccountId': 'string',
            'Type': 'string',
            'State': 'string',
            'StartTime': datetime(2015, 1, 1),
            'EndTime': datetime(2015, 1, 1),
            'Edges': [
                {
                    'ReferenceId': 123,
                    'StartTime': datetime(2015, 1, 1),
                    'EndTime': datetime(2015, 1, 1),
                    'SummaryStatistics': {
                        'OkCount': 123,
                        'ErrorStatistics': {
                            'ThrottleCount': 123,
                            'OtherCount': 123,
                            'TotalCount': 123
                        },
                        'FaultStatistics': {
                            'OtherCount': 123,
                            'TotalCount': 123
                        },
                        'TotalCount': 123,
                        'TotalResponseTime': 123.0
                    },
                    'ResponseTimeHistogram': [
                        {
                            'Value': 123.0,
                            'Count': 123
                        },
                    ],
                    'Aliases': [
                        {
                            'Name': 'string',
                            'Names': [
                                'string',
                            ],
                            'Type': 'string'
                        },
                    ]
                },
            ],
            'SummaryStatistics': {
                'OkCount': 123,
                'ErrorStatistics': {
                    'ThrottleCount': 123,
                    'OtherCount': 123,
                    'TotalCount': 123
                },
                'FaultStatistics': {
                    'OtherCount': 123,
                    'TotalCount': 123
                },
                'TotalCount': 123,
                'TotalResponseTime': 123.0
            },
            'DurationHistogram': [
                {
                    'Value': 123.0,
                    'Count': 123
                },
            ],
            'ResponseTimeHistogram': [
                {
                    'Value': 123.0,
                    'Count': 123
                },
            ]
        },
    ],
    'ContainsOldGroupVersions': True|False,
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • StartTime (datetime) --

      The start of the time frame for which the graph was generated.

    • EndTime (datetime) --

      The end of the time frame for which the graph was generated.

    • Services (list) --

      The services that have processed a traced request during the specified time frame.

      • (dict) --

        Information about an application that processed requests, users that made requests, or downstream services, resources and applications that an application used.

        • ReferenceId (integer) --

          Identifier for the service. Unique within the service map.

        • Name (string) --

          The canonical name of the service.

        • Names (list) --

          A list of names for the service, including the canonical name.

          • (string) --

        • Root (boolean) --

          Indicates that the service was the first service to process a request.

        • AccountId (string) --

          Identifier of the AWS account in which the service runs.

        • Type (string) --

          The type of service.

          • AWS Resource - The type of an AWS resource. For example, AWS::EC2::Instance for a application running on Amazon EC2 or AWS::DynamoDB::Table for an Amazon DynamoDB table that the application used.

          • AWS Service - The type of an AWS service. For example, AWS::DynamoDB for downstream calls to Amazon DynamoDB that didn't target a specific table.

          • client - Represents the clients that sent requests to a root service.

          • remote - A downstream service of indeterminate type.

        • State (string) --

          The service's state.

        • StartTime (datetime) --

          The start time of the first segment that the service generated.

        • EndTime (datetime) --

          The end time of the last segment that the service generated.

        • Edges (list) --

          Connections to downstream services.

          • (dict) --

            Information about a connection between two services.

            • ReferenceId (integer) --

              Identifier of the edge. Unique within a service map.

            • StartTime (datetime) --

              The start time of the first segment on the edge.

            • EndTime (datetime) --

              The end time of the last segment on the edge.

            • SummaryStatistics (dict) --

              Response statistics for segments on the edge.

              • OkCount (integer) --

                The number of requests that completed with a 2xx Success status code.

              • ErrorStatistics (dict) --

                Information about requests that failed with a 4xx Client Error status code.

                • ThrottleCount (integer) --

                  The number of requests that failed with a 419 throttling status code.

                • OtherCount (integer) --

                  The number of requests that failed with untracked 4xx Client Error status codes.

                • TotalCount (integer) --

                  The total number of requests that failed with a 4xx Client Error status code.

              • FaultStatistics (dict) --

                Information about requests that failed with a 5xx Server Error status code.

                • OtherCount (integer) --

                  The number of requests that failed with untracked 5xx Server Error status codes.

                • TotalCount (integer) --

                  The total number of requests that failed with a 5xx Server Error status code.

              • TotalCount (integer) --

                The total number of completed requests.

              • TotalResponseTime (float) --

                The aggregate response time of completed requests.

            • ResponseTimeHistogram (list) --

              A histogram that maps the spread of client response times on an edge.

              • (dict) --

                An entry in a histogram for a statistic. A histogram maps the range of observed values on the X axis, and the prevalence of each value on the Y axis.

                • Value (float) --

                  The value of the entry.

                • Count (integer) --

                  The prevalence of the entry.

            • Aliases (list) --

              Aliases for the edge.

              • (dict) --

                An alias for an edge.

                • Name (string) --

                  The canonical name of the alias.

                • Names (list) --

                  A list of names for the alias, including the canonical name.

                  • (string) --

                • Type (string) --

                  The type of the alias.

        • SummaryStatistics (dict) --

          Aggregated statistics for the service.

          • OkCount (integer) --

            The number of requests that completed with a 2xx Success status code.

          • ErrorStatistics (dict) --

            Information about requests that failed with a 4xx Client Error status code.

            • ThrottleCount (integer) --

              The number of requests that failed with a 419 throttling status code.

            • OtherCount (integer) --

              The number of requests that failed with untracked 4xx Client Error status codes.

            • TotalCount (integer) --

              The total number of requests that failed with a 4xx Client Error status code.

          • FaultStatistics (dict) --

            Information about requests that failed with a 5xx Server Error status code.

            • OtherCount (integer) --

              The number of requests that failed with untracked 5xx Server Error status codes.

            • TotalCount (integer) --

              The total number of requests that failed with a 5xx Server Error status code.

          • TotalCount (integer) --

            The total number of completed requests.

          • TotalResponseTime (float) --

            The aggregate response time of completed requests.

        • DurationHistogram (list) --

          A histogram that maps the spread of service durations.

          • (dict) --

            An entry in a histogram for a statistic. A histogram maps the range of observed values on the X axis, and the prevalence of each value on the Y axis.

            • Value (float) --

              The value of the entry.

            • Count (integer) --

              The prevalence of the entry.

        • ResponseTimeHistogram (list) --

          A histogram that maps the spread of service response times.

          • (dict) --

            An entry in a histogram for a statistic. A histogram maps the range of observed values on the X axis, and the prevalence of each value on the Y axis.

            • Value (float) --

              The value of the entry.

            • Count (integer) --

              The prevalence of the entry.

    • ContainsOldGroupVersions (boolean) --

      A flag indicating whether or not the group's filter expression has been consistent, or if the returned service graph may show traces from an older version of the group's filter expression.

    • NextToken (string) --

      Pagination token. Not used.