aws-cdk-lib.aws_xray.CfnSamplingRule.SamplingRuleProperty

interface SamplingRuleProperty

LanguageType name
.NETAmazon.CDK.AWS.XRay.CfnSamplingRule.SamplingRuleProperty
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsxray#CfnSamplingRule_SamplingRuleProperty
Javasoftware.amazon.awscdk.services.xray.CfnSamplingRule.SamplingRuleProperty
Pythonaws_cdk.aws_xray.CfnSamplingRule.SamplingRuleProperty
TypeScript aws-cdk-lib » aws_xray » CfnSamplingRule » SamplingRuleProperty

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.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_xray as xray } from 'aws-cdk-lib';
const samplingRuleProperty: xray.CfnSamplingRule.SamplingRuleProperty = {
  fixedRate: 123,
  host: 'host',
  httpMethod: 'httpMethod',
  priority: 123,
  reservoirSize: 123,
  resourceArn: 'resourceArn',
  serviceName: 'serviceName',
  serviceType: 'serviceType',
  urlPath: 'urlPath',

  // the properties below are optional
  attributes: {
    attributesKey: 'attributes',
  },
  ruleArn: 'ruleArn',
  ruleName: 'ruleName',
  version: 123,
};

Properties

NameTypeDescription
fixedRatenumberThe percentage of matching requests to instrument, after the reservoir is exhausted.
hoststringMatches the hostname from a request URL.
httpMethodstringMatches the HTTP method of a request.
prioritynumberThe priority of the sampling rule.
reservoirSizenumberA fixed number of matching requests to instrument per second, prior to applying the fixed rate.
resourceArnstringMatches the ARN of the AWS resource on which the service runs.
serviceNamestringMatches the name that the service uses to identify itself in segments.
serviceTypestringMatches the origin that the service uses to identify its type in segments.
urlPathstringMatches the path from a request URL.
attributes?IResolvable | { [string]: string }Matches attributes derived from the request.
ruleArn?stringThe ARN of the sampling rule. Specify a rule by either name or ARN, but not both.
ruleName?stringThe name of the sampling rule.
version?numberThe version of the sampling rule.

fixedRate

Type: number

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


host

Type: string

Matches the hostname from a request URL.


httpMethod

Type: string

Matches the HTTP method of a request.


priority

Type: number

The priority of the sampling rule.


reservoirSize

Type: number

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.


resourceArn

Type: string

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


serviceName

Type: string

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


serviceType

Type: string

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


urlPath

Type: string

Matches the path from a request URL.


attributes?

Type: IResolvable | { [string]: string } (optional)

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.


ruleArn?

Type: string (optional)

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.


ruleName?

Type: string (optional)

The name of the sampling rule.

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


version?

Type: number (optional)

The version of the sampling rule.

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