Class CfnSamplingRule
Use the AWS::XRay::SamplingRule
resource to specify a sampling rule, which controls sampling behavior for instrumented applications.
Inherited Members
Namespace: Amazon.CDK.AWS.XRay
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnSamplingRule : CfnResource, IInspectable, ITaggableV2
Syntax (vb)
Public Class CfnSamplingRule
Inherits CfnResource
Implements IInspectable, ITaggableV2
Remarks
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.
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-xray-samplingrule.html
CloudformationResource: AWS::XRay::SamplingRule
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.XRay;
var cfnSamplingRule = new CfnSamplingRule(this, "MyCfnSamplingRule", new CfnSamplingRuleProps {
RuleName = "ruleName",
SamplingRule = new 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 = new Dictionary<string, string> {
{ "attributesKey", "attributes" }
},
RuleArn = "ruleArn",
RuleName = "ruleName",
Version = 123
},
SamplingRuleRecord = new SamplingRuleRecordProperty {
CreatedAt = "createdAt",
ModifiedAt = "modifiedAt",
SamplingRule = new 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 = new Dictionary<string, string> {
{ "attributesKey", "attributes" }
},
RuleArn = "ruleArn",
RuleName = "ruleName",
Version = 123
}
},
SamplingRuleUpdate = new SamplingRuleUpdateProperty {
Attributes = new Dictionary<string, string> {
{ "attributesKey", "attributes" }
},
FixedRate = 123,
Host = "host",
HttpMethod = "httpMethod",
Priority = 123,
ReservoirSize = 123,
ResourceArn = "resourceArn",
RuleArn = "ruleArn",
RuleName = "ruleName",
ServiceName = "serviceName",
ServiceType = "serviceType",
UrlPath = "urlPath"
},
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
});
Synopsis
Constructors
CfnSamplingRule(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnSamplingRule(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
CfnSamplingRule(Construct, String, ICfnSamplingRuleProps) |
Properties
AttrRuleArn | The sampling rule ARN that was created or updated. |
CdkTagManager | Tag Manager which manages the tags for this resource. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
RuleName | (deprecated) The ARN of the sampling rule. |
SamplingRule | The sampling rule to be created or updated. |
SamplingRuleRecord | |
SamplingRuleUpdate | |
Tags | An array of key-value pairs to apply to this resource. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnSamplingRule(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnSamplingRule(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnSamplingRule(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnSamplingRule(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
CfnSamplingRule(Construct, String, ICfnSamplingRuleProps)
public CfnSamplingRule(Construct scope, string id, ICfnSamplingRuleProps props = null)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnSamplingRuleProps
Resource properties.
Properties
AttrRuleArn
The sampling rule ARN that was created or updated.
public virtual string AttrRuleArn { get; }
Property Value
System.String
Remarks
CloudformationAttribute: RuleARN
CdkTagManager
Tag Manager which manages the tags for this resource.
public virtual TagManager CdkTagManager { get; }
Property Value
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
RuleName
(deprecated) The ARN of the sampling rule.
public virtual string RuleName { get; set; }
Property Value
System.String
Remarks
Stability: Deprecated
SamplingRule
The sampling rule to be created or updated.
public virtual object SamplingRule { get; set; }
Property Value
System.Object
SamplingRuleRecord
public virtual object SamplingRuleRecord { get; set; }
Property Value
System.Object
Remarks
Stability: Deprecated
SamplingRuleUpdate
public virtual object SamplingRuleUpdate { get; set; }
Property Value
System.Object
Remarks
Stability: Deprecated
Tags
An array of key-value pairs to apply to this resource.
public virtual ICfnTag[] Tags { get; set; }
Property Value
ICfnTag[]
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>