Class CfnSamplingRule
- All Implemented Interfaces:
IConstruct
,IDependable
,IInspectable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
AWS::XRay::SamplingRule
.
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 , 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.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.xray.*; Object tags; CfnSamplingRule cfnSamplingRule = CfnSamplingRule.Builder.create(this, "MyCfnSamplingRule") .samplingRule(SamplingRuleProperty.builder() .fixedRate(123) .host("host") .httpMethod("httpMethod") .priority(123) .reservoirSize(123) .resourceArn("resourceArn") .serviceName("serviceName") .serviceType("serviceType") .urlPath("urlPath") // the properties below are optional .attributes(Map.of( "attributesKey", "attributes")) .ruleArn("ruleArn") .ruleName("ruleName") .version(123) .build()) .tags(List.of(tags)) .build();
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A fluent builder forCfnSamplingRule
.static interface
A sampling rule that services use to decide whether to instrument a request.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionCfnSamplingRule
(Construct scope, String id) Create a newAWS::XRay::SamplingRule
.CfnSamplingRule
(Construct scope, String id, CfnSamplingRuleProps props) Create a newAWS::XRay::SamplingRule
.protected
CfnSamplingRule
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnSamplingRule
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionThe sampling rule ARN that was created or updated.The sampling rule to be created or updated.getTags()
An array of key-value pairs to apply to this resource.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setSamplingRule
(IResolvable value) The sampling rule to be created or updated.void
The sampling rule to be created or updated.void
An array of key-value pairs to apply to this resource.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.core.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnSamplingRule
protected CfnSamplingRule(software.amazon.jsii.JsiiObjectRef objRef) -
CfnSamplingRule
protected CfnSamplingRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnSamplingRule
@Stability(Stable) public CfnSamplingRule(@NotNull Construct scope, @NotNull String id, @Nullable CfnSamplingRuleProps props) Create a newAWS::XRay::SamplingRule
.- Parameters:
scope
-- scope in which this resource is defined.
id
-- scoped id of the resource.
props
-- resource properties.
-
CfnSamplingRule
Create a newAWS::XRay::SamplingRule
.- Parameters:
scope
-- scope in which this resource is defined.
id
-- scoped id of the resource.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrRuleArn
The sampling rule ARN that was created or updated. -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getSamplingRule
The sampling rule to be created or updated. -
setSamplingRule
The sampling rule to be created or updated. -
setSamplingRule
@Stability(Stable) public void setSamplingRule(@Nullable CfnSamplingRule.SamplingRuleProperty value) The sampling rule to be created or updated. -
getTags
An array of key-value pairs to apply to this resource. -
setTags
An array of key-value pairs to apply to this resource.
-