Class RouteAction.RequestMirrorPolicy
java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
io.envoyproxy.envoy.config.route.v3.RouteAction.RequestMirrorPolicy
- All Implemented Interfaces:
com.google.protobuf.Message
,com.google.protobuf.MessageLite
,com.google.protobuf.MessageLiteOrBuilder
,com.google.protobuf.MessageOrBuilder
,RouteAction.RequestMirrorPolicyOrBuilder
,Serializable
- Enclosing class:
RouteAction
public static final class RouteAction.RequestMirrorPolicy
extends com.google.protobuf.GeneratedMessage
implements RouteAction.RequestMirrorPolicyOrBuilder
The router is capable of shadowing traffic from one cluster to another. The current implementation is "fire and forget," meaning Envoy will not wait for the shadow cluster to respond before returning the response from the primary cluster. All normal statistics are collected for the shadow cluster making this feature useful for testing. During shadowing, the host/authority header is altered such that ``-shadow`` is appended. This is useful for logging. For example, ``cluster1`` becomes ``cluster1-shadow``. This behavior can be disabled by setting ``disable_shadow_host_suffix_append`` to ``true``. .. note:: Shadowing will not be triggered if the primary cluster does not exist. .. note:: Shadowing doesn't support Http CONNECT and upgrades. [#next-free-field: 7]Protobuf type
envoy.config.route.v3.RouteAction.RequestMirrorPolicy
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
The router is capable of shadowing traffic from one cluster to another.Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessage
com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>,
BuilderT extends com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT, BuilderT>>, com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.FieldAccessorTable, com.google.protobuf.GeneratedMessage.GeneratedExtension<ContainingT extends com.google.protobuf.Message, T>, com.google.protobuf.GeneratedMessage.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessage
com.google.protobuf.AbstractMessage.BuilderParent
Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private Object
static final int
static final int
private Object
private static final RouteAction.RequestMirrorPolicy
static final int
private boolean
private byte
private static final com.google.protobuf.Parser
<RouteAction.RequestMirrorPolicy> static final int
private RuntimeFractionalPercent
private static final long
static final int
private com.google.protobuf.BoolValue
Fields inherited from class com.google.protobuf.GeneratedMessage
alwaysUseFieldBuilders, unknownFields
Fields inherited from class com.google.protobuf.AbstractMessage
memoizedSize
Fields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
private
RequestMirrorPolicy
(com.google.protobuf.GeneratedMessage.Builder<?> builder) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Only one of ``cluster`` and ``cluster_header`` can be specified.com.google.protobuf.ByteString
Only one of ``cluster`` and ``cluster_header`` can be specified.Only one of ``cluster`` and ``cluster_header`` can be specified.com.google.protobuf.ByteString
Only one of ``cluster`` and ``cluster_header`` can be specified.static final com.google.protobuf.Descriptors.Descriptor
boolean
Disables appending the ``-shadow`` suffix to the shadowed ``Host`` header.com.google.protobuf.Parser
<RouteAction.RequestMirrorPolicy> If not specified, all requests to the target cluster will be mirrored.If not specified, all requests to the target cluster will be mirrored.int
com.google.protobuf.BoolValue
Determines if the trace span should be sampled.com.google.protobuf.BoolValueOrBuilder
Determines if the trace span should be sampled.int
hashCode()
boolean
If not specified, all requests to the target cluster will be mirrored.boolean
Determines if the trace span should be sampled.protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
final boolean
newBuilder
(RouteAction.RequestMirrorPolicy prototype) protected RouteAction.RequestMirrorPolicy.Builder
newBuilderForType
(com.google.protobuf.AbstractMessage.BuilderParent parent) parseDelimitedFrom
(InputStream input) parseDelimitedFrom
(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) parseFrom
(byte[] data) parseFrom
(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) parseFrom
(com.google.protobuf.ByteString data) parseFrom
(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) parseFrom
(com.google.protobuf.CodedInputStream input) parseFrom
(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) parseFrom
(InputStream input) parseFrom
(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) parseFrom
(ByteBuffer data) parseFrom
(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser
<RouteAction.RequestMirrorPolicy> parser()
void
writeTo
(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessage
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, newFileScopedGeneratedExtension, newInstance, newMessageScopedGeneratedExtension, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag
Methods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashFields, toString
Methods inherited from class com.google.protobuf.AbstractMessageLite
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeTo
Methods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
bitField0_
private int bitField0_ -
CLUSTER_FIELD_NUMBER
public static final int CLUSTER_FIELD_NUMBER- See Also:
-
cluster_
-
CLUSTER_HEADER_FIELD_NUMBER
public static final int CLUSTER_HEADER_FIELD_NUMBER- See Also:
-
clusterHeader_
-
RUNTIME_FRACTION_FIELD_NUMBER
public static final int RUNTIME_FRACTION_FIELD_NUMBER- See Also:
-
runtimeFraction_
-
TRACE_SAMPLED_FIELD_NUMBER
public static final int TRACE_SAMPLED_FIELD_NUMBER- See Also:
-
traceSampled_
private com.google.protobuf.BoolValue traceSampled_ -
DISABLE_SHADOW_HOST_SUFFIX_APPEND_FIELD_NUMBER
public static final int DISABLE_SHADOW_HOST_SUFFIX_APPEND_FIELD_NUMBER- See Also:
-
disableShadowHostSuffixAppend_
private boolean disableShadowHostSuffixAppend_ -
memoizedIsInitialized
private byte memoizedIsInitialized -
DEFAULT_INSTANCE
-
PARSER
-
-
Constructor Details
-
RequestMirrorPolicy
private RequestMirrorPolicy(com.google.protobuf.GeneratedMessage.Builder<?> builder) -
RequestMirrorPolicy
private RequestMirrorPolicy()
-
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTable
in classcom.google.protobuf.GeneratedMessage
-
getCluster
Only one of ``cluster`` and ``cluster_header`` can be specified. [#next-major-version: Need to add back the validation rule: (validate.rules).string = {min_len: 1}] Specifies the cluster that requests will be mirrored to. The cluster must exist in the cluster manager configuration.
string cluster = 1 [(.udpa.annotations.field_migrate) = { ... }
- Specified by:
getCluster
in interfaceRouteAction.RequestMirrorPolicyOrBuilder
- Returns:
- The cluster.
-
getClusterBytes
public com.google.protobuf.ByteString getClusterBytes()Only one of ``cluster`` and ``cluster_header`` can be specified. [#next-major-version: Need to add back the validation rule: (validate.rules).string = {min_len: 1}] Specifies the cluster that requests will be mirrored to. The cluster must exist in the cluster manager configuration.
string cluster = 1 [(.udpa.annotations.field_migrate) = { ... }
- Specified by:
getClusterBytes
in interfaceRouteAction.RequestMirrorPolicyOrBuilder
- Returns:
- The bytes for cluster.
-
getClusterHeader
Only one of ``cluster`` and ``cluster_header`` can be specified. Envoy will determine the cluster to route to by reading the value of the HTTP header named by cluster_header from the request headers. Only the first value in header is used, and no shadow request will happen if the value is not found in headers. Envoy will not wait for the shadow cluster to respond before returning the response from the primary cluster. .. attention:: Internally, Envoy always uses the HTTP/2 ``:authority`` header to represent the HTTP/1 ``Host`` header. Thus, if attempting to match on ``Host``, match on ``:authority`` instead. .. note:: If the header appears multiple times only the first value is used.
string cluster_header = 5 [(.validate.rules) = { ... }
- Specified by:
getClusterHeader
in interfaceRouteAction.RequestMirrorPolicyOrBuilder
- Returns:
- The clusterHeader.
-
getClusterHeaderBytes
public com.google.protobuf.ByteString getClusterHeaderBytes()Only one of ``cluster`` and ``cluster_header`` can be specified. Envoy will determine the cluster to route to by reading the value of the HTTP header named by cluster_header from the request headers. Only the first value in header is used, and no shadow request will happen if the value is not found in headers. Envoy will not wait for the shadow cluster to respond before returning the response from the primary cluster. .. attention:: Internally, Envoy always uses the HTTP/2 ``:authority`` header to represent the HTTP/1 ``Host`` header. Thus, if attempting to match on ``Host``, match on ``:authority`` instead. .. note:: If the header appears multiple times only the first value is used.
string cluster_header = 5 [(.validate.rules) = { ... }
- Specified by:
getClusterHeaderBytes
in interfaceRouteAction.RequestMirrorPolicyOrBuilder
- Returns:
- The bytes for clusterHeader.
-
hasRuntimeFraction
public boolean hasRuntimeFraction()If not specified, all requests to the target cluster will be mirrored. If specified, this field takes precedence over the ``runtime_key`` field and requests must also fall under the percentage of matches indicated by this field. For some fraction N/D, a random number in the range [0,D) is selected. If the number is <= the value of the numerator N, or if the key is not present, the default value, the request will be mirrored.
.envoy.config.core.v3.RuntimeFractionalPercent runtime_fraction = 3;
- Specified by:
hasRuntimeFraction
in interfaceRouteAction.RequestMirrorPolicyOrBuilder
- Returns:
- Whether the runtimeFraction field is set.
-
getRuntimeFraction
If not specified, all requests to the target cluster will be mirrored. If specified, this field takes precedence over the ``runtime_key`` field and requests must also fall under the percentage of matches indicated by this field. For some fraction N/D, a random number in the range [0,D) is selected. If the number is <= the value of the numerator N, or if the key is not present, the default value, the request will be mirrored.
.envoy.config.core.v3.RuntimeFractionalPercent runtime_fraction = 3;
- Specified by:
getRuntimeFraction
in interfaceRouteAction.RequestMirrorPolicyOrBuilder
- Returns:
- The runtimeFraction.
-
getRuntimeFractionOrBuilder
If not specified, all requests to the target cluster will be mirrored. If specified, this field takes precedence over the ``runtime_key`` field and requests must also fall under the percentage of matches indicated by this field. For some fraction N/D, a random number in the range [0,D) is selected. If the number is <= the value of the numerator N, or if the key is not present, the default value, the request will be mirrored.
.envoy.config.core.v3.RuntimeFractionalPercent runtime_fraction = 3;
- Specified by:
getRuntimeFractionOrBuilder
in interfaceRouteAction.RequestMirrorPolicyOrBuilder
-
hasTraceSampled
public boolean hasTraceSampled()Determines if the trace span should be sampled. Defaults to true.
.google.protobuf.BoolValue trace_sampled = 4;
- Specified by:
hasTraceSampled
in interfaceRouteAction.RequestMirrorPolicyOrBuilder
- Returns:
- Whether the traceSampled field is set.
-
getTraceSampled
public com.google.protobuf.BoolValue getTraceSampled()Determines if the trace span should be sampled. Defaults to true.
.google.protobuf.BoolValue trace_sampled = 4;
- Specified by:
getTraceSampled
in interfaceRouteAction.RequestMirrorPolicyOrBuilder
- Returns:
- The traceSampled.
-
getTraceSampledOrBuilder
public com.google.protobuf.BoolValueOrBuilder getTraceSampledOrBuilder()Determines if the trace span should be sampled. Defaults to true.
.google.protobuf.BoolValue trace_sampled = 4;
- Specified by:
getTraceSampledOrBuilder
in interfaceRouteAction.RequestMirrorPolicyOrBuilder
-
getDisableShadowHostSuffixAppend
public boolean getDisableShadowHostSuffixAppend()Disables appending the ``-shadow`` suffix to the shadowed ``Host`` header. Defaults to ``false``.
bool disable_shadow_host_suffix_append = 6;
- Specified by:
getDisableShadowHostSuffixAppend
in interfaceRouteAction.RequestMirrorPolicyOrBuilder
- Returns:
- The disableShadowHostSuffixAppend.
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitialized
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Overrides:
isInitialized
in classcom.google.protobuf.GeneratedMessage
-
writeTo
- Specified by:
writeTo
in interfacecom.google.protobuf.MessageLite
- Overrides:
writeTo
in classcom.google.protobuf.GeneratedMessage
- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSize
in interfacecom.google.protobuf.MessageLite
- Overrides:
getSerializedSize
in classcom.google.protobuf.GeneratedMessage
-
equals
- Specified by:
equals
in interfacecom.google.protobuf.Message
- Overrides:
equals
in classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfacecom.google.protobuf.Message
- Overrides:
hashCode
in classcom.google.protobuf.AbstractMessage
-
parseFrom
public static RouteAction.RequestMirrorPolicy parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RouteAction.RequestMirrorPolicy parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RouteAction.RequestMirrorPolicy parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RouteAction.RequestMirrorPolicy parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RouteAction.RequestMirrorPolicy parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RouteAction.RequestMirrorPolicy parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static RouteAction.RequestMirrorPolicy parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
public static RouteAction.RequestMirrorPolicy parseDelimitedFrom(InputStream input) throws IOException - Throws:
IOException
-
parseDelimitedFrom
public static RouteAction.RequestMirrorPolicy parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
public static RouteAction.RequestMirrorPolicy parseFrom(com.google.protobuf.CodedInputStream input) throws IOException - Throws:
IOException
-
parseFrom
public static RouteAction.RequestMirrorPolicy parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilderForType
- Specified by:
newBuilderForType
in interfacecom.google.protobuf.Message
- Specified by:
newBuilderForType
in interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
public static RouteAction.RequestMirrorPolicy.Builder newBuilder(RouteAction.RequestMirrorPolicy prototype) -
toBuilder
- Specified by:
toBuilder
in interfacecom.google.protobuf.Message
- Specified by:
toBuilder
in interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected RouteAction.RequestMirrorPolicy.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) - Overrides:
newBuilderForType
in classcom.google.protobuf.AbstractMessage
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForType
in interfacecom.google.protobuf.Message
- Specified by:
getParserForType
in interfacecom.google.protobuf.MessageLite
- Overrides:
getParserForType
in classcom.google.protobuf.GeneratedMessage
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageOrBuilder
-