CfnSamplingRulePropsMixin
- class aws_cdk.mixins_preview.aws_xray.mixins.CfnSamplingRulePropsMixin(props, *, strategy=None)
Bases:
MixinUse the
AWS::XRay::SamplingRuleresource to specify a sampling rule, which controls sampling behavior for instrumented applications.Include a
SamplingRuleentity 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:
props (
Union[CfnSamplingRuleMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- 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
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- 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:
objectA 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 thenamethat the service uses to identify itself in segments.service_type (
Optional[str]) – Matches theoriginthat 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.Versioncan only be set when creating a new sampling rule.
- See:
- 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.
- fixed_rate
The percentage of matching requests to instrument, after the reservoir is exhausted.
- host
Matches the hostname from a request URL.
- http_method
Matches the HTTP method of a request.
- priority
The priority of the sampling rule.
- 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.
- resource_arn
Matches the ARN of the AWS resource on which the service runs.
- 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.
- rule_name
The name of the sampling rule.
Specify a rule by either name or ARN, but not both.
- service_name
Matches the
namethat the service uses to identify itself in segments.
- service_type
Matches the
originthat the service uses to identify its type in segments.
- url_path
Matches the path from a request URL.
- version
The version of the sampling rule.
Versioncan only be set when creating a new sampling rule.
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:
- 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.
- modified_at
When the rule was modified, in Unix time seconds.
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:
- 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.
- fixed_rate
The percentage of matching requests to instrument, after the reservoir is exhausted.
- host
Matches the hostname from a request URL.
- http_method
Matches the HTTP method from a request URL.
- priority
The priority of the sampling rule.
- 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.
- resource_arn
Matches the ARN of the AWS resource on which the service runs.
- rule_arn
The ARN of the sampling rule.
Specify a rule by either name or ARN, but not both.
- rule_name
The ARN of the sampling rule.
Specify a rule by either name or ARN, but not both.
- service_name
Matches the name that the service uses to identify itself in segments.
- service_type
Matches the origin that the service uses to identify its type in segments.
- url_path
Matches the path from a request URL.