Class CfnSamplingRule.SamplingRuleProperty
A sampling rule that services use to decide whether to instrument a request.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.XRay
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnSamplingRule.SamplingRuleProperty : CfnSamplingRule.ISamplingRuleProperty
Syntax (vb)
Public Class CfnSamplingRule.SamplingRuleProperty Implements CfnSamplingRule.ISamplingRuleProperty
Remarks
Rule fields can match properties of the service, or properties of a request. The service can ignore rules that don't match its properties.
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 samplingRuleProperty = 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
};
Synopsis
Constructors
SamplingRuleProperty() | A sampling rule that services use to decide whether to instrument a request. |
Properties
Attributes | Matches attributes derived from the request. |
FixedRate | The percentage of matching requests to instrument, after the reservoir is exhausted. |
Host | Matches the hostname from a request URL. |
HttpMethod | Matches the HTTP method of a request. |
Priority | The priority of the sampling rule. |
ReservoirSize | A fixed number of matching requests to instrument per second, prior to applying the fixed rate. |
ResourceArn | Matches the ARN of the AWS resource on which the service runs. |
RuleArn | The ARN of the sampling rule. Specify a rule by either name or ARN, but not both. |
RuleName | The name of the sampling rule. |
ServiceName | Matches the |
ServiceType | Matches the |
UrlPath | Matches the path from a request URL. |
Version | The version of the sampling rule. |
Constructors
SamplingRuleProperty()
A sampling rule that services use to decide whether to instrument a request.
public SamplingRuleProperty()
Remarks
Rule fields can match properties of the service, or properties of a request. The service can ignore rules that don't match its properties.
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 samplingRuleProperty = 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
};
Properties
Attributes
Matches attributes derived from the request.
public object? Attributes { get; set; }
Property Value
Remarks
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.
FixedRate
The percentage of matching requests to instrument, after the reservoir is exhausted.
public double FixedRate { get; set; }
Property Value
Remarks
Host
Matches the hostname from a request URL.
public string Host { get; set; }
Property Value
Remarks
HttpMethod
Matches the HTTP method of a request.
public string HttpMethod { get; set; }
Property Value
Remarks
Priority
The priority of the sampling rule.
public double Priority { get; set; }
Property Value
Remarks
ReservoirSize
A fixed number of matching requests to instrument per second, prior to applying the fixed rate.
public double ReservoirSize { get; set; }
Property Value
Remarks
The reservoir is not used directly by services, but applies to all services using the rule collectively.
ResourceArn
Matches the ARN of the AWS resource on which the service runs.
public string ResourceArn { get; set; }
Property Value
Remarks
RuleArn
The ARN of the sampling rule. Specify a rule by either name or ARN, but not both.
public string? RuleArn { get; set; }
Property Value
Remarks
Specifying a sampling rule by name is recommended, as specifying by ARN will be deprecated in future.
RuleName
The name of the sampling rule.
public string? RuleName { get; set; }
Property Value
Remarks
Specify a rule by either name or ARN, but not both.
ServiceName
Matches the name
that the service uses to identify itself in segments.
public string ServiceName { get; set; }
Property Value
Remarks
ServiceType
Matches the origin
that the service uses to identify its type in segments.
public string ServiceType { get; set; }
Property Value
Remarks
UrlPath
Matches the path from a request URL.
public string UrlPath { get; set; }
Property Value
Remarks
Version
The version of the sampling rule.
public double? Version { get; set; }
Property Value
Remarks
Version
can only be set when creating a new sampling rule.