CfnSamplingRulePropsMixin

class aws_cdk.mixins_preview.aws_xray.mixins.CfnSamplingRulePropsMixin(props, *, strategy=None)

Bases: Mixin

Use the AWS::XRay::SamplingRule resource to specify a sampling rule, which controls sampling behavior for instrumented applications.

Include a SamplingRule entity to create or update a sampling rule. .. epigraph:

``SamplingRule.Version`` can only be set when creating a sampling rule. Updating the version will cause the update to fail.

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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-xray-samplingrule.html

CloudformationResource:

AWS::XRay::SamplingRule

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_xray import mixins as xray_mixins

cfn_sampling_rule_props_mixin = xray_mixins.CfnSamplingRulePropsMixin(xray_mixins.CfnSamplingRuleMixinProps(
    rule_name="ruleName",
    sampling_rule=xray_mixins.CfnSamplingRulePropsMixin.SamplingRuleProperty(
        attributes={
            "attributes_key": "attributes"
        },
        fixed_rate=123,
        host="host",
        http_method="httpMethod",
        priority=123,
        reservoir_size=123,
        resource_arn="resourceArn",
        rule_arn="ruleArn",
        rule_name="ruleName",
        service_name="serviceName",
        service_type="serviceType",
        url_path="urlPath",
        version=123
    ),
    sampling_rule_record=xray_mixins.CfnSamplingRulePropsMixin.SamplingRuleRecordProperty(
        created_at="createdAt",
        modified_at="modifiedAt",
        sampling_rule=xray_mixins.CfnSamplingRulePropsMixin.SamplingRuleProperty(
            attributes={
                "attributes_key": "attributes"
            },
            fixed_rate=123,
            host="host",
            http_method="httpMethod",
            priority=123,
            reservoir_size=123,
            resource_arn="resourceArn",
            rule_arn="ruleArn",
            rule_name="ruleName",
            service_name="serviceName",
            service_type="serviceType",
            url_path="urlPath",
            version=123
        )
    ),
    sampling_rule_update=xray_mixins.CfnSamplingRulePropsMixin.SamplingRuleUpdateProperty(
        attributes={
            "attributes_key": "attributes"
        },
        fixed_rate=123,
        host="host",
        http_method="httpMethod",
        priority=123,
        reservoir_size=123,
        resource_arn="resourceArn",
        rule_arn="ruleArn",
        rule_name="ruleName",
        service_name="serviceName",
        service_type="serviceType",
        url_path="urlPath"
    ),
    tags=[CfnTag(
        key="key",
        value="value"
    )]
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::XRay::SamplingRule.

Parameters:

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['ruleName', 'samplingRule', 'samplingRuleRecord', 'samplingRuleUpdate', 'tags']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

SamplingRuleProperty

class CfnSamplingRulePropsMixin.SamplingRuleProperty(*, attributes=None, fixed_rate=None, host=None, http_method=None, priority=None, reservoir_size=None, resource_arn=None, rule_arn=None, rule_name=None, service_name=None, service_type=None, url_path=None, version=None)

Bases: object

A sampling rule that services use to decide whether to instrument a request.

Rule fields can match properties of the service, or properties of a request. The service can ignore rules that don’t match its properties.

Parameters:
  • attributes (Union[Mapping[str, str], IResolvable, None]) – Matches attributes derived from the request. Map Entries: Maximum number of 5 items. Key Length Constraints: Minimum length of 1. Maximum length of 32. Value Length Constraints: Minimum length of 1. Maximum length of 32.

  • fixed_rate (Union[int, float, None]) – The percentage of matching requests to instrument, after the reservoir is exhausted.

  • host (Optional[str]) – Matches the hostname from a request URL.

  • http_method (Optional[str]) – Matches the HTTP method of a request.

  • priority (Union[int, float, None]) – The priority of the sampling rule.

  • reservoir_size (Union[int, float, None]) – 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.

  • resource_arn (Optional[str]) – Matches the ARN of the AWS resource on which the service runs.

  • rule_arn (Optional[str]) – The ARN of the sampling rule. Specify a rule by either name or ARN, but not both. .. epigraph:: Specifying a sampling rule by name is recommended, as specifying by ARN will be deprecated in future.

  • rule_name (Optional[str]) – The name of the sampling rule. Specify a rule by either name or ARN, but not both.

  • service_name (Optional[str]) – Matches the name that the service uses to identify itself in segments.

  • service_type (Optional[str]) – Matches the origin that the service uses to identify its type in segments.

  • url_path (Optional[str]) – Matches the path from a request URL.

  • version (Union[int, float, None]) – The version of the sampling rule. Version can only be set when creating a new sampling rule.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingrule.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_xray import mixins as xray_mixins

sampling_rule_property = xray_mixins.CfnSamplingRulePropsMixin.SamplingRuleProperty(
    attributes={
        "attributes_key": "attributes"
    },
    fixed_rate=123,
    host="host",
    http_method="httpMethod",
    priority=123,
    reservoir_size=123,
    resource_arn="resourceArn",
    rule_arn="ruleArn",
    rule_name="ruleName",
    service_name="serviceName",
    service_type="serviceType",
    url_path="urlPath",
    version=123
)

Attributes

attributes

Matches attributes derived from the request.

Map Entries: Maximum number of 5 items.

Key Length Constraints: Minimum length of 1. Maximum length of 32.

Value Length Constraints: Minimum length of 1. Maximum length of 32.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingrule.html#cfn-xray-samplingrule-samplingrule-attributes

fixed_rate

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingrule.html#cfn-xray-samplingrule-samplingrule-fixedrate

host

Matches the hostname from a request URL.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingrule.html#cfn-xray-samplingrule-samplingrule-host

http_method

Matches the HTTP method of a request.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingrule.html#cfn-xray-samplingrule-samplingrule-httpmethod

priority

The priority of the sampling rule.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingrule.html#cfn-xray-samplingrule-samplingrule-priority

reservoir_size

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingrule.html#cfn-xray-samplingrule-samplingrule-reservoirsize

resource_arn

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingrule.html#cfn-xray-samplingrule-samplingrule-resourcearn

rule_arn

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

Specifying a sampling rule by name is recommended, as specifying by ARN will be deprecated in future.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingrule.html#cfn-xray-samplingrule-samplingrule-rulearn

rule_name

The name of the sampling rule.

Specify a rule by either name or ARN, but not both.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingrule.html#cfn-xray-samplingrule-samplingrule-rulename

service_name

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingrule.html#cfn-xray-samplingrule-samplingrule-servicename

service_type

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingrule.html#cfn-xray-samplingrule-samplingrule-servicetype

url_path

Matches the path from a request URL.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingrule.html#cfn-xray-samplingrule-samplingrule-urlpath

version

The version of the sampling rule.

Version can only be set when creating a new sampling rule.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingrule.html#cfn-xray-samplingrule-samplingrule-version

SamplingRuleRecordProperty

class CfnSamplingRulePropsMixin.SamplingRuleRecordProperty(*, created_at=None, modified_at=None, sampling_rule=None)

Bases: object

Parameters:
  • created_at (Optional[str]) – When the rule was created, in Unix time seconds.

  • modified_at (Optional[str]) – When the rule was modified, in Unix time seconds.

  • sampling_rule (Union[IResolvable, SamplingRuleProperty, Dict[str, Any], None])

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingrulerecord.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_xray import mixins as xray_mixins

sampling_rule_record_property = xray_mixins.CfnSamplingRulePropsMixin.SamplingRuleRecordProperty(
    created_at="createdAt",
    modified_at="modifiedAt",
    sampling_rule=xray_mixins.CfnSamplingRulePropsMixin.SamplingRuleProperty(
        attributes={
            "attributes_key": "attributes"
        },
        fixed_rate=123,
        host="host",
        http_method="httpMethod",
        priority=123,
        reservoir_size=123,
        resource_arn="resourceArn",
        rule_arn="ruleArn",
        rule_name="ruleName",
        service_name="serviceName",
        service_type="serviceType",
        url_path="urlPath",
        version=123
    )
)

Attributes

created_at

When the rule was created, in Unix time seconds.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingrulerecord.html#cfn-xray-samplingrule-samplingrulerecord-createdat

modified_at

When the rule was modified, in Unix time seconds.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingrulerecord.html#cfn-xray-samplingrule-samplingrulerecord-modifiedat

sampling_rule

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingrulerecord.html#cfn-xray-samplingrule-samplingrulerecord-samplingrule

Type:

see

SamplingRuleUpdateProperty

class CfnSamplingRulePropsMixin.SamplingRuleUpdateProperty(*, attributes=None, fixed_rate=None, host=None, http_method=None, priority=None, reservoir_size=None, resource_arn=None, rule_arn=None, rule_name=None, service_name=None, service_type=None, url_path=None)

Bases: object

Parameters:
  • attributes (Union[Mapping[str, str], IResolvable, None]) – Matches attributes derived from the request.

  • fixed_rate (Union[int, float, None]) – The percentage of matching requests to instrument, after the reservoir is exhausted.

  • host (Optional[str]) – Matches the hostname from a request URL.

  • http_method (Optional[str]) – Matches the HTTP method from a request URL.

  • priority (Union[int, float, None]) – The priority of the sampling rule.

  • reservoir_size (Union[int, float, None]) – 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.

  • resource_arn (Optional[str]) – Matches the ARN of the AWS resource on which the service runs.

  • rule_arn (Optional[str]) – The ARN of the sampling rule. Specify a rule by either name or ARN, but not both.

  • rule_name (Optional[str]) – The ARN of the sampling rule. Specify a rule by either name or ARN, but not both.

  • service_name (Optional[str]) – Matches the name that the service uses to identify itself in segments.

  • service_type (Optional[str]) – Matches the origin that the service uses to identify its type in segments.

  • url_path (Optional[str]) – Matches the path from a request URL.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingruleupdate.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_xray import mixins as xray_mixins

sampling_rule_update_property = xray_mixins.CfnSamplingRulePropsMixin.SamplingRuleUpdateProperty(
    attributes={
        "attributes_key": "attributes"
    },
    fixed_rate=123,
    host="host",
    http_method="httpMethod",
    priority=123,
    reservoir_size=123,
    resource_arn="resourceArn",
    rule_arn="ruleArn",
    rule_name="ruleName",
    service_name="serviceName",
    service_type="serviceType",
    url_path="urlPath"
)

Attributes

attributes

Matches attributes derived from the request.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingruleupdate.html#cfn-xray-samplingrule-samplingruleupdate-attributes

fixed_rate

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingruleupdate.html#cfn-xray-samplingrule-samplingruleupdate-fixedrate

host

Matches the hostname from a request URL.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingruleupdate.html#cfn-xray-samplingrule-samplingruleupdate-host

http_method

Matches the HTTP method from a request URL.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingruleupdate.html#cfn-xray-samplingrule-samplingruleupdate-httpmethod

priority

The priority of the sampling rule.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingruleupdate.html#cfn-xray-samplingrule-samplingruleupdate-priority

reservoir_size

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingruleupdate.html#cfn-xray-samplingrule-samplingruleupdate-reservoirsize

resource_arn

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingruleupdate.html#cfn-xray-samplingrule-samplingruleupdate-resourcearn

rule_arn

The ARN of the sampling rule.

Specify a rule by either name or ARN, but not both.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingruleupdate.html#cfn-xray-samplingrule-samplingruleupdate-rulearn

rule_name

The ARN of the sampling rule.

Specify a rule by either name or ARN, but not both.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingruleupdate.html#cfn-xray-samplingrule-samplingruleupdate-rulename

service_name

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingruleupdate.html#cfn-xray-samplingrule-samplingruleupdate-servicename

service_type

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingruleupdate.html#cfn-xray-samplingrule-samplingruleupdate-servicetype

url_path

Matches the path from a request URL.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-xray-samplingrule-samplingruleupdate.html#cfn-xray-samplingrule-samplingruleupdate-urlpath