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 classThe 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.BuilderParentNested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate Objectstatic final intstatic final intprivate Objectprivate static final RouteAction.RequestMirrorPolicystatic final intprivate booleanprivate byteprivate static final com.google.protobuf.Parser<RouteAction.RequestMirrorPolicy> static final intprivate RuntimeFractionalPercentprivate static final longstatic final intprivate com.google.protobuf.BoolValueFields inherited from class com.google.protobuf.GeneratedMessage
alwaysUseFieldBuilders, loggedPre22TypeNames, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateprivateRequestMirrorPolicy(com.google.protobuf.GeneratedMessage.Builder<?> builder) -
Method Summary
Modifier and TypeMethodDescriptionbooleanOnly one of ``cluster`` and ``cluster_header`` can be specified.com.google.protobuf.ByteStringOnly one of ``cluster`` and ``cluster_header`` can be specified.Only one of ``cluster`` and ``cluster_header`` can be specified.com.google.protobuf.ByteStringOnly one of ``cluster`` and ``cluster_header`` can be specified.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorbooleanDisables 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.intcom.google.protobuf.BoolValueDetermines if the trace span should be sampled.com.google.protobuf.BoolValueOrBuilderDetermines if the trace span should be sampled.inthashCode()booleanIf not specified, all requests to the target cluster will be mirrored.booleanDetermines if the trace span should be sampled.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleannewBuilder(RouteAction.RequestMirrorPolicy prototype) protected RouteAction.RequestMirrorPolicy.BuildernewBuilderForType(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()voidwriteTo(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessage
computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, newFileScopedGeneratedExtension, newInstance, newMessageScopedGeneratedExtension, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashFields, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, 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() -
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein 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:
getClusterin 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:
getClusterBytesin 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:
getClusterHeaderin 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:
getClusterHeaderBytesin 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:
hasRuntimeFractionin 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:
getRuntimeFractionin 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:
getRuntimeFractionOrBuilderin 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:
hasTraceSampledin 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:
getTraceSampledin 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:
getTraceSampledOrBuilderin 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:
getDisableShadowHostSuffixAppendin interfaceRouteAction.RequestMirrorPolicyOrBuilder- Returns:
- The disableShadowHostSuffixAppend.
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessage- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessage
-
equals
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein 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:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
public static RouteAction.RequestMirrorPolicy.Builder newBuilder(RouteAction.RequestMirrorPolicy prototype) -
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected RouteAction.RequestMirrorPolicy.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) - Overrides:
newBuilderForTypein classcom.google.protobuf.AbstractMessage
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessage
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-