Interface SegmentNamingStrategy
- All Known Implementing Classes:
DynamicSegmentNamingStrategy
,FixedSegmentNamingStrategy
public interface SegmentNamingStrategy
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic SegmentNamingStrategy
Returns aSegmentNamingStrategy
that names segments based on theHost
header of incoming requests, accepting anyHost
header value.static SegmentNamingStrategy
Returns aSegmentNamingStrategy
that names segments based on theHost
header of incoming requests, accepting only recognizedHost
header values.static SegmentNamingStrategy
Returns aSegmentNamingStrategy
that assigns the providedname
to all segments generated for incoming requests.default @Nullable String
nameForRequest
(jakarta.servlet.http.HttpServletRequest request)
-
Field Details
-
NAME_OVERRIDE_ENVIRONMENT_VARIABLE_KEY
Environment variable key used to override the default segment name used by implementors ofSegmentNamingStrategy
. Takes precedence over any system property, web.xml configuration value, or constructor value used for a fixed segment name.- See Also:
-
NAME_OVERRIDE_SYSTEM_PROPERTY_KEY
System property key used to override the default segment name used by implementors ofSegmentNamingStrategy
. Takes precedence over any web.xml configuration value or constructor value used for a fixed segment name.- See Also:
-
-
Method Details
-
fixed
Returns aSegmentNamingStrategy
that assigns the providedname
to all segments generated for incoming requests. This will be ignored and will use the the value of theAWS_XRAY_TRACING_NAME
environment variable orcom.amazonaws.xray.strategy.tracingName
system property if set. -
dynamic
Returns aSegmentNamingStrategy
that names segments based on theHost
header of incoming requests, accepting anyHost
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 theAWS_XRAY_TRACING_NAME
environment variable orcom.amazonaws.xray.strategy.tracingName
system property, if either are set to a non-empty value.
-
dynamic
Returns aSegmentNamingStrategy
that names segments based on theHost
header of incoming requests, accepting only recognizedHost
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 theAWS_XRAY_TRACING_NAME
environment variable orcom.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 theSearchPattern.wildcardMatch(String, String)
method.
-
nameForRequest
-
getOverrideName
-