AWS::XRay::SamplingRuleUse 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. > `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](https://docs.aws.amazon.com//xray/latest/api/API_GetSamplingRules.html) , 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](https://docs.aws.amazon.com//xray/latest/api/API_GetSamplingTargets.html) 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.
import { CfnSamplingRule } from 'aws-cdk-lib/aws-xray';Or use the module namespace:
import * as xray from 'aws-cdk-lib/aws-xray';
// xray.CfnSamplingRuleConfiguration passed to the constructor as CfnSamplingRuleProps.
ruleNameOptionalDeprecatedstringThe ARN of the sampling rule. Specify a rule by either name or ARN, but not both.
Deprecated: this property has been deprecated
samplingRuleOptionalIResolvable | SamplingRulePropertyThe sampling rule to be created or updated.
samplingRuleRecordOptionalDeprecatedIResolvable | SamplingRuleRecordPropertyDeprecated: this property has been deprecated
samplingRuleUpdateOptionalDeprecatedIResolvable | SamplingRuleUpdatePropertyDeprecated: this property has been deprecated
tagsOptionalCfnTag[]An array of key-value pairs to apply to this resource.
This L1 construct maps directly to the following CloudFormation resource type.
Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.
Subscribe to Newsletteraws-xrayAWS::XRay::SamplingRule