Package com.amazonaws.xray.strategy
Interface SegmentNamingStrategy
-
- All Known Implementing Classes:
DynamicSegmentNamingStrategy
,FixedSegmentNamingStrategy
public interface SegmentNamingStrategy
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NAME_OVERRIDE_ENVIRONMENT_VARIABLE_KEY
Environment variable key used to override the default segment name used by implementors ofSegmentNamingStrategy
.static java.lang.String
NAME_OVERRIDE_SYSTEM_PROPERTY_KEY
System property key used to override the default segment name used by implementors ofSegmentNamingStrategy
.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static SegmentNamingStrategy
dynamic(java.lang.String fallbackName)
Returns aSegmentNamingStrategy
that names segments based on theHost
header of incoming requests, accepting anyHost
header value.static SegmentNamingStrategy
dynamic(java.lang.String fallbackName, java.lang.String recognizedHosts)
Returns aSegmentNamingStrategy
that names segments based on theHost
header of incoming requests, accepting only recognizedHost
header values.static SegmentNamingStrategy
fixed(java.lang.String name)
Returns aSegmentNamingStrategy
that assigns the providedname
to all segments generated for incoming requests.default @Nullable java.lang.String
getOverrideName()
java.lang.String
nameForRequest(javax.servlet.http.HttpServletRequest request)
-
-
-
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 ofSegmentNamingStrategy
. 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 ofSegmentNamingStrategy
. 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 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
static SegmentNamingStrategy dynamic(java.lang.String fallbackName)
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
static SegmentNamingStrategy dynamic(java.lang.String fallbackName, java.lang.String recognizedHosts)
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
java.lang.String nameForRequest(javax.servlet.http.HttpServletRequest request)
-
getOverrideName
default @Nullable java.lang.String getOverrideName()
-
-