Interface CfnSamplingRule.SamplingRuleProperty

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
CfnSamplingRule.SamplingRuleProperty.Jsii$Proxy
Enclosing class:
CfnSamplingRule

@Stability(Stable) public static interface CfnSamplingRule.SamplingRuleProperty extends software.amazon.jsii.JsiiSerializable
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 software.amazon.awscdk.services.xray.*;
 SamplingRuleProperty samplingRuleProperty = 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();
 
  • Method Details

    • getFixedRate

      @Stability(Stable) @NotNull Number getFixedRate()
      The percentage of matching requests to instrument, after the reservoir is exhausted.
    • getHost

      @Stability(Stable) @NotNull String getHost()
      Matches the hostname from a request URL.
    • getHttpMethod

      @Stability(Stable) @NotNull String getHttpMethod()
      Matches the HTTP method of a request.
    • getPriority

      @Stability(Stable) @NotNull Number getPriority()
      The priority of the sampling rule.
    • getReservoirSize

      @Stability(Stable) @NotNull Number getReservoirSize()
      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.

    • getResourceArn

      @Stability(Stable) @NotNull String getResourceArn()
      Matches the ARN of the AWS resource on which the service runs.
    • getServiceName

      @Stability(Stable) @NotNull String getServiceName()
      Matches the name that the service uses to identify itself in segments.
    • getServiceType

      @Stability(Stable) @NotNull String getServiceType()
      Matches the origin that the service uses to identify its type in segments.
    • getUrlPath

      @Stability(Stable) @NotNull String getUrlPath()
      Matches the path from a request URL.
    • getAttributes

      @Stability(Stable) @Nullable default Object getAttributes()
      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.

    • getRuleArn

      @Stability(Stable) @Nullable default String getRuleArn()
      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.

    • getRuleName

      @Stability(Stable) @Nullable default String getRuleName()
      The name of the sampling rule.

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

    • getVersion

      @Stability(Stable) @Nullable default Number getVersion()
      The version of the sampling rule.

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

    • builder

      @Stability(Stable) static CfnSamplingRule.SamplingRuleProperty.Builder builder()
      Returns:
      a CfnSamplingRule.SamplingRuleProperty.Builder of CfnSamplingRule.SamplingRuleProperty