@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:42.835Z") @Stability(value=Stable) public class CfnSamplingRule extends CfnResource implements IInspectable
Use the AWS::XRay::SamplingRule resource to specify a sampling rule, which controls sampling behavior for instrumented applications. A new sampling rule is created by specifying a SamplingRule . To change the configuration of an existing sampling rule, specify a SamplingRuleUpdate .
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")
.ruleName("ruleName")
.samplingRule(SamplingRuleProperty.builder()
.attributes(Map.of(
"attributesKey", "attributes"))
.fixedRate(123)
.host("host")
.httpMethod("httpMethod")
.priority(123)
.reservoirSize(123)
.resourceArn("resourceArn")
.ruleArn("ruleArn")
.ruleName("ruleName")
.serviceName("serviceName")
.serviceType("serviceType")
.urlPath("urlPath")
.version(123)
.build())
.samplingRuleRecord(SamplingRuleRecordProperty.builder()
.createdAt("createdAt")
.modifiedAt("modifiedAt")
.samplingRule(SamplingRuleProperty.builder()
.attributes(Map.of(
"attributesKey", "attributes"))
.fixedRate(123)
.host("host")
.httpMethod("httpMethod")
.priority(123)
.reservoirSize(123)
.resourceArn("resourceArn")
.ruleArn("ruleArn")
.ruleName("ruleName")
.serviceName("serviceName")
.serviceType("serviceType")
.urlPath("urlPath")
.version(123)
.build())
.build())
.samplingRuleUpdate(SamplingRuleUpdateProperty.builder()
.attributes(Map.of(
"attributesKey", "attributes"))
.fixedRate(123)
.host("host")
.httpMethod("httpMethod")
.priority(123)
.reservoirSize(123)
.resourceArn("resourceArn")
.ruleArn("ruleArn")
.ruleName("ruleName")
.serviceName("serviceName")
.serviceType("serviceType")
.urlPath("urlPath")
.build())
.tags(List.of(tags))
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnSamplingRule.Builder
A fluent builder for
CfnSamplingRule. |
static interface |
CfnSamplingRule.SamplingRuleProperty
A sampling rule that services use to decide whether to instrument a request.
|
static interface |
CfnSamplingRule.SamplingRuleRecordProperty
A [SamplingRule](https://docs.aws.amazon.com//xray/latest/api/API_SamplingRule.html) and its metadata.
|
static interface |
CfnSamplingRule.SamplingRuleUpdateProperty
A document specifying changes to a sampling rule's configuration.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnSamplingRule(software.constructs.Construct scope,
String id)
Create a new `AWS::XRay::SamplingRule`.
|
|
CfnSamplingRule(software.constructs.Construct scope,
String id,
CfnSamplingRuleProps props)
Create a new `AWS::XRay::SamplingRule`.
|
protected |
CfnSamplingRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnSamplingRule(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAttrRuleArn()
The sampling rule ARN that was created or updated.
|
protected Map<String,Object> |
getCfnProperties() |
String |
getRuleName()
The name of the sampling rule.
|
Object |
getSamplingRule()
The sampling rule to be created.
|
Object |
getSamplingRuleRecord()
`AWS::XRay::SamplingRule.SamplingRuleRecord`.
|
Object |
getSamplingRuleUpdate()
A document specifying changes to a sampling rule's configuration.
|
List<Object> |
getTags()
An array of key-value pairs to apply to this resource.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setRuleName(String value)
The name of the sampling rule.
|
void |
setSamplingRule(CfnSamplingRule.SamplingRuleProperty value)
The sampling rule to be created.
|
void |
setSamplingRule(IResolvable value)
The sampling rule to be created.
|
void |
setSamplingRuleRecord(CfnSamplingRule.SamplingRuleRecordProperty value)
`AWS::XRay::SamplingRule.SamplingRuleRecord`.
|
void |
setSamplingRuleRecord(IResolvable value)
`AWS::XRay::SamplingRule.SamplingRuleRecord`.
|
void |
setSamplingRuleUpdate(CfnSamplingRule.SamplingRuleUpdateProperty value)
A document specifying changes to a sampling rule's configuration.
|
void |
setSamplingRuleUpdate(IResolvable value)
A document specifying changes to a sampling rule's configuration.
|
void |
setTags(List<Object> value)
An array of key-value pairs to apply to this resource.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnSamplingRule(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnSamplingRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnSamplingRule(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@Nullable
CfnSamplingRuleProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties.@Stability(value=Stable)
public CfnSamplingRule(@NotNull
software.constructs.Construct scope,
@NotNull
String id)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrRuleArn()
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @Nullable public String getRuleName()
Specify a rule by either name or ARN, but not both. Used only when deleting a sampling rule. When creating or updating a sampling rule, use the RuleName or RuleARN properties within SamplingRule or SamplingRuleUpdate .
@Stability(value=Stable)
public void setRuleName(@Nullable
String value)
Specify a rule by either name or ARN, but not both. Used only when deleting a sampling rule. When creating or updating a sampling rule, use the RuleName or RuleARN properties within SamplingRule or SamplingRuleUpdate .
@Stability(value=Stable) @Nullable public Object getSamplingRule()
Must be provided if creating a new sampling rule. Not valid when updating an existing sampling rule.
@Stability(value=Stable)
public void setSamplingRule(@Nullable
CfnSamplingRule.SamplingRuleProperty value)
Must be provided if creating a new sampling rule. Not valid when updating an existing sampling rule.
@Stability(value=Stable)
public void setSamplingRule(@Nullable
IResolvable value)
Must be provided if creating a new sampling rule. Not valid when updating an existing sampling rule.
@Stability(value=Stable) @Nullable public Object getSamplingRuleRecord()
@Stability(value=Stable)
public void setSamplingRuleRecord(@Nullable
CfnSamplingRule.SamplingRuleRecordProperty value)
@Stability(value=Stable)
public void setSamplingRuleRecord(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public Object getSamplingRuleUpdate()
Must be provided if updating an existing sampling rule. Not valid when creating a new sampling rule.
The
Versionof a sampling rule cannot be updated, and is not part ofSamplingRuleUpdate.
@Stability(value=Stable)
public void setSamplingRuleUpdate(@Nullable
CfnSamplingRule.SamplingRuleUpdateProperty value)
Must be provided if updating an existing sampling rule. Not valid when creating a new sampling rule.
The
Versionof a sampling rule cannot be updated, and is not part ofSamplingRuleUpdate.
@Stability(value=Stable)
public void setSamplingRuleUpdate(@Nullable
IResolvable value)
Must be provided if updating an existing sampling rule. Not valid when creating a new sampling rule.
The
Versionof a sampling rule cannot be updated, and is not part ofSamplingRuleUpdate.
@Stability(value=Stable) @Nullable public List<Object> getTags()
For more information, see Tag .
Copyright © 2022. All rights reserved.