# CfnSamplingRulePropsMixin

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.

Extends: Mixin › CfnSamplingRulePropsMixin
Implements: IMixin

- CloudFormation: [`AWS::XRay::SamplingRule`](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-xray-samplingrule.html)
- Source: Generated code
- Type last changed: v2.269.0 · 16 Sep 2026

## Initializer

```ts
new CfnSamplingRulePropsMixin(props: CfnSamplingRuleMixinProps, options?: CfnPropertyMixinOptions)
```

## Methods

- `applyTo(construct: IConstruct): void` — Apply the mixin properties to the construct.

- `isMixin(x: any): boolean` (static) — Checks if `x` is a Mixin.

  **Parameters**

  - `x` — Any object.

  **Returns:** true if `x` is an object created from a class which extends `Mixin`.

- `supports(construct: IConstruct): boolean` — Check if this mixin supports the given construct.
