Interface SegmentNamingStrategy

    • Field Detail

      • NAME_OVERRIDE_ENVIRONMENT_VARIABLE_KEY

        static final java.lang.String NAME_OVERRIDE_ENVIRONMENT_VARIABLE_KEY
        Environment variable key used to override the default segment name used by implementors of SegmentNamingStrategy. Takes precedence over any system property, web.xml configuration value, or constructor value used for a fixed segment name.
        See Also:
        Constant Field Values
      • NAME_OVERRIDE_SYSTEM_PROPERTY_KEY

        static final java.lang.String NAME_OVERRIDE_SYSTEM_PROPERTY_KEY
        System property key used to override the default segment name used by implementors of SegmentNamingStrategy. Takes precedence over any web.xml configuration value or constructor value used for a fixed segment name.
        See Also:
        Constant Field Values
    • Method Detail

      • fixed

        static SegmentNamingStrategy fixed​(java.lang.String name)
        Returns a SegmentNamingStrategy that assigns the provided name to all segments generated for incoming requests. This will be ignored and will use the the value of the AWS_XRAY_TRACING_NAME environment variable or com.amazonaws.xray.strategy.tracingName system property if set.
      • dynamic

        static SegmentNamingStrategy dynamic​(java.lang.String fallbackName)
        Returns a SegmentNamingStrategy that names segments based on the Host header of incoming requests, accepting any Host header value.
        Parameters:
        fallbackName - the fallback segment name used when no host header is included in the incoming request or the incoming host header value does not match the provided pattern. This will be overriden by the value of the AWS_XRAY_TRACING_NAME environment variable or com.amazonaws.xray.strategy.tracingName system property, if either are set to a non-empty value.
      • dynamic

        static SegmentNamingStrategy dynamic​(java.lang.String fallbackName,
                                             java.lang.String recognizedHosts)
        Returns a SegmentNamingStrategy that names segments based on the Host header of incoming requests, accepting only recognized Host header values.
        Parameters:
        fallbackName - the fallback segment name used when no host header is included in the incoming request or the incoming host header value does not match the provided pattern. This will be overriden by the value of the AWS_XRAY_TRACING_NAME environment variable or com.amazonaws.xray.strategy.tracingName system property, if either are set to a non-empty value.
        recognizedHosts - the pattern to match the incoming host header value against. This pattern is compared against the incoming host header using the SearchPattern.wildcardMatch(String, String) method.
      • nameForRequest

        java.lang.String nameForRequest​(javax.servlet.http.HttpServletRequest request)
      • getOverrideName

        default @Nullable java.lang.String getOverrideName()