AWS X-Ray

2020/08/24 - AWS X-Ray - 3 new2 updated api methods

Changes  Update xray client to latest version

ListTagsForResource (new) Link ¶

See also: AWS API Documentation

Request Syntax

client.list_tags_for_resource(
    ResourceARN='string',
    NextToken='string'
)
type ResourceARN:

string

param ResourceARN:

[REQUIRED]

type NextToken:

string

param NextToken:

rtype:

dict

returns:

Response Syntax

{
    'Tags': [
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Tags (list) --

      • (dict) --

        • Key (string) --

        • Value (string) --

    • NextToken (string) --

UntagResource (new) Link ¶

See also: AWS API Documentation

Request Syntax

client.untag_resource(
    ResourceARN='string',
    TagKeys=[
        'string',
    ]
)
type ResourceARN:

string

param ResourceARN:

[REQUIRED]

type TagKeys:

list

param TagKeys:

[REQUIRED]

  • (string) --

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

TagResource (new) Link ¶

See also: AWS API Documentation

Request Syntax

client.tag_resource(
    ResourceARN='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type ResourceARN:

string

param ResourceARN:

[REQUIRED]

type Tags:

list

param Tags:

[REQUIRED]

  • (dict) --

    • Key (string) -- [REQUIRED]

    • Value (string) -- [REQUIRED]

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

CreateGroup (updated) Link ¶
Changes (request)
{'Tags': [{'Key': 'string', 'Value': 'string'}]}

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',
    Tags=[
        {
            'Key': 'string',
            'Value': '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.

type Tags:

list

param Tags:
  • (dict) --

    • Key (string) -- [REQUIRED]

    • Value (string) -- [REQUIRED]

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.

CreateSamplingRule (updated) Link ¶
Changes (request)
{'Tags': [{'Key': 'string', 'Value': 'string'}]}

Creates a rule to control sampling behavior for instrumented applications. Services retrieve rules with GetSamplingRules, and evaluate each rule in ascending order of priority for each request. If a rule matches, the service records a trace, borrowing it from the reservoir size. After 10 seconds, the service reports back to X-Ray with GetSamplingTargets to get updated versions of each in-use rule. The updated rule contains a trace quota that the service can use instead of borrowing from the reservoir.

See also: AWS API Documentation

Request Syntax

client.create_sampling_rule(
    SamplingRule={
        'RuleName': 'string',
        'RuleARN': 'string',
        'ResourceARN': 'string',
        'Priority': 123,
        'FixedRate': 123.0,
        'ReservoirSize': 123,
        'ServiceName': 'string',
        'ServiceType': 'string',
        'Host': 'string',
        'HTTPMethod': 'string',
        'URLPath': 'string',
        'Version': 123,
        'Attributes': {
            'string': 'string'
        }
    },
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type SamplingRule:

dict

param SamplingRule:

[REQUIRED]

The rule definition.

  • RuleName (string) --

    The name of the sampling rule. Specify a rule by either name or ARN, but not both.

  • RuleARN (string) --

    The ARN of the sampling rule. Specify a rule by either name or ARN, but not both.

  • ResourceARN (string) -- [REQUIRED]

    Matches the ARN of the AWS resource on which the service runs.

  • Priority (integer) -- [REQUIRED]

    The priority of the sampling rule.

  • FixedRate (float) -- [REQUIRED]

    The percentage of matching requests to instrument, after the reservoir is exhausted.

  • ReservoirSize (integer) -- [REQUIRED]

    A fixed number of matching requests to instrument per second, prior to applying the fixed rate. The reservoir is not used directly by services, but applies to all services using the rule collectively.

  • ServiceName (string) -- [REQUIRED]

    Matches the name that the service uses to identify itself in segments.

  • ServiceType (string) -- [REQUIRED]

    Matches the origin that the service uses to identify its type in segments.

  • Host (string) -- [REQUIRED]

    Matches the hostname from a request URL.

  • HTTPMethod (string) -- [REQUIRED]

    Matches the HTTP method of a request.

  • URLPath (string) -- [REQUIRED]

    Matches the path from a request URL.

  • Version (integer) -- [REQUIRED]

    The version of the sampling rule format ( 1).

  • Attributes (dict) --

    Matches attributes derived from the request.

    • (string) --

      • (string) --

type Tags:

list

param Tags:
  • (dict) --

    • Key (string) -- [REQUIRED]

    • Value (string) -- [REQUIRED]

rtype:

dict

returns:

Response Syntax

{
    'SamplingRuleRecord': {
        'SamplingRule': {
            'RuleName': 'string',
            'RuleARN': 'string',
            'ResourceARN': 'string',
            'Priority': 123,
            'FixedRate': 123.0,
            'ReservoirSize': 123,
            'ServiceName': 'string',
            'ServiceType': 'string',
            'Host': 'string',
            'HTTPMethod': 'string',
            'URLPath': 'string',
            'Version': 123,
            'Attributes': {
                'string': 'string'
            }
        },
        'CreatedAt': datetime(2015, 1, 1),
        'ModifiedAt': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • SamplingRuleRecord (dict) --

      The saved rule definition and metadata.

      • SamplingRule (dict) --

        The sampling rule.

        • RuleName (string) --

          The name of the sampling rule. Specify a rule by either name or ARN, but not both.

        • RuleARN (string) --

          The ARN of the sampling rule. Specify a rule by either name or ARN, but not both.

        • ResourceARN (string) --

          Matches the ARN of the AWS resource on which the service runs.

        • Priority (integer) --

          The priority of the sampling rule.

        • FixedRate (float) --

          The percentage of matching requests to instrument, after the reservoir is exhausted.

        • ReservoirSize (integer) --

          A fixed number of matching requests to instrument per second, prior to applying the fixed rate. The reservoir is not used directly by services, but applies to all services using the rule collectively.

        • ServiceName (string) --

          Matches the name that the service uses to identify itself in segments.

        • ServiceType (string) --

          Matches the origin that the service uses to identify its type in segments.

        • Host (string) --

          Matches the hostname from a request URL.

        • HTTPMethod (string) --

          Matches the HTTP method of a request.

        • URLPath (string) --

          Matches the path from a request URL.

        • Version (integer) --

          The version of the sampling rule format ( 1).

        • Attributes (dict) --

          Matches attributes derived from the request.

          • (string) --

            • (string) --

      • CreatedAt (datetime) --

        When the rule was created.

      • ModifiedAt (datetime) --

        When the rule was last modified.