AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::XRay::SamplingRule

CfnSamplingRule

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. > `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

import { CfnSamplingRule } from 'aws-cdk-lib/aws-xray';

Or use the module namespace:

import * as xray from 'aws-cdk-lib/aws-xray';
// xray.CfnSamplingRule

Properties

Configuration passed to the constructor as CfnSamplingRuleProps.

ruleNameOptionalDeprecated
string

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

Deprecated: this property has been deprecated

samplingRuleOptional
IResolvable | SamplingRuleProperty

The sampling rule to be created or updated.

samplingRuleRecordOptionalDeprecated
IResolvable | SamplingRuleRecordProperty

Deprecated: this property has been deprecated

samplingRuleUpdateOptionalDeprecated
IResolvable | SamplingRuleUpdateProperty

Deprecated: this property has been deprecated

tagsOptional
CfnTag[]

An array of key-value pairs to apply to this resource.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter

Quick Facts

LevelL1 (CloudFormation)
Moduleaws-xray
CFN TypeAWS::XRay::SamplingRule
Properties5

External Links