Package org.microproxy
Enum Class ResponseFlag
- All Implemented Interfaces:
Serializable,Comparable<ResponseFlag>,Constable
Why an exchange or a flow ended the way it did, in the vocabulary of Envoy's access-log response
flags: each constant has Envoy's short code (
UF, UT, ...) and long name, so logs
read by tools made for Envoy keep their meaning. FlowContext.responseFlags() has the
flags of the exchange in progress (or the last one); access logs render them with
%RESPONSE_FLAGS% and %RESPONSE_FLAGS_LONG%.
The proxy sets the flags that apply to it (see the response flags
reference); the
others exist so filters and configurations can name every Envoy flag, and so a filter can set
one with FlowContext.addResponseFlag(org.microproxy.ResponseFlag). The constants are in Envoy's order, which is the
order flags are rendered in.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDI: the request was delayed on purpose.DF: the server's name did not resolve.DC: the client went away before the response was complete.DPE: the client's request was malformed, refused as such, or too large.DR: the client reset its HTTP/2 or HTTP/3 stream.DO: the request was dropped under overload.DT: the request exceeded its maximum duration.LH: a local health check failed.FI: a fault was injected.IH: the request had invalid proxy-specific headers.LR: the proxy reset the stream itself.NC: no upstream cluster was found.NFCF: no filter configuration was found.UH: no healthy upstream.NR: there was nowhere to send the request.OM: the request was refused under overload.RLSE: the rate-limit service failed.RL: the request was refused by a rate or concurrency limit.RFCF: served by a cache filter.SI: the exchange, tunnel or flow sat idle for the idle timeout.UAEX: the client was refused by the proxy authenticator.UDO: the request was dropped unconditionally under overload.UF: no connection could be made to the server, or its TLS handshake failed.UC: the server closed the connection before its response head was complete.UMSDR: the upstream stream reached its maximum duration.UO: no server connection was available (the shared pool was exhausted).UPE: the server's response was malformed.UR: the server reset the stream or closed the connection mid-response.UT: the server did not answer within the idle timeout.URX: every route was tried (with backoff between chained proxies) and failed. -
Method Summary
Modifier and TypeMethodDescriptioncode()Returns Envoy's short code, such asUF.longName()Returns Envoy's long name, such asUpstreamConnectionFailure.static ResponseFlagThe flag with the short code or long namename, ignoring case, or with this enum's constant name (UPSTREAM_CONNECTION_FAILURE).static Stringrender(Set<ResponseFlag> flags, boolean longNames) Rendersflagsas Envoy does: the short (or long) names in this enum's order, separated by commas, or-when there are none.static ResponseFlagReturns the enum constant of this class with the specified name.static ResponseFlag[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FAILED_LOCAL_HEALTH_CHECK
LH: a local health check failed. Not set by the proxy. -
NO_HEALTHY_UPSTREAM
UH: no healthy upstream. Not set by the proxy. -
UPSTREAM_REQUEST_TIMEOUT
UT: the server did not answer within the idle timeout. -
LOCAL_RESET
LR: the proxy reset the stream itself. -
UPSTREAM_REMOTE_RESET
UR: the server reset the stream or closed the connection mid-response. -
UPSTREAM_CONNECTION_FAILURE
UF: no connection could be made to the server, or its TLS handshake failed. -
UPSTREAM_CONNECTION_TERMINATION
UC: the server closed the connection before its response head was complete. -
UPSTREAM_OVERFLOW
UO: no server connection was available (the shared pool was exhausted). -
NO_ROUTE_FOUND
NR: there was nowhere to send the request. -
DELAY_INJECTED
DI: the request was delayed on purpose. Not set by the proxy. -
FAULT_INJECTED
FI: a fault was injected. Not set by the proxy. -
RATE_LIMITED
RL: the request was refused by a rate or concurrency limit. -
UNAUTHORIZED_EXTERNAL_SERVICE
UAEX: the client was refused by the proxy authenticator. -
RATE_LIMIT_SERVICE_ERROR
RLSE: the rate-limit service failed. Not set by the proxy. -
DOWNSTREAM_CONNECTION_TERMINATION
DC: the client went away before the response was complete. -
UPSTREAM_RETRY_LIMIT_EXCEEDED
URX: every route was tried (with backoff between chained proxies) and failed. -
STREAM_IDLE_TIMEOUT
SI: the exchange, tunnel or flow sat idle for the idle timeout. -
INVALID_ENVOY_REQUEST_HEADERS
IH: the request had invalid proxy-specific headers. Not set by the proxy. -
DOWNSTREAM_PROTOCOL_ERROR
DPE: the client's request was malformed, refused as such, or too large. -
UPSTREAM_MAX_STREAM_DURATION_REACHED
UMSDR: the upstream stream reached its maximum duration. Not set by the proxy. -
RESPONSE_FROM_CACHE_FILTER
RFCF: served by a cache filter. Not set by the proxy, which sayscachein the details. -
NO_FILTER_CONFIG_FOUND
NFCF: no filter configuration was found. Not set by the proxy. -
DURATION_TIMEOUT
DT: the request exceeded its maximum duration. Not set by the proxy. -
UPSTREAM_PROTOCOL_ERROR
UPE: the server's response was malformed. -
NO_CLUSTER_FOUND
NC: no upstream cluster was found. Not set by the proxy. -
OVERLOAD_MANAGER
OM: the request was refused under overload. Not set by the proxy. -
DNS_RESOLUTION_FAILED
DF: the server's name did not resolve. -
DROP_OVERLOAD
DO: the request was dropped under overload. Not set by the proxy. -
DOWNSTREAM_REMOTE_RESET
DR: the client reset its HTTP/2 or HTTP/3 stream. -
UNCONDITIONAL_DROP_OVERLOAD
UDO: the request was dropped unconditionally under overload. Not set by the proxy.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
code
Returns Envoy's short code, such asUF.- Returns:
- Envoy's short code, such as
UF
-
longName
Returns Envoy's long name, such asUpstreamConnectionFailure.- Returns:
- Envoy's long name, such as
UpstreamConnectionFailure
-
of
The flag with the short code or long namename, ignoring case, or with this enum's constant name (UPSTREAM_CONNECTION_FAILURE).- Parameters:
name- a short code, long name or constant name- Returns:
- the flag
- Throws:
IllegalArgumentException- if no flag has that name
-
render
Rendersflagsas Envoy does: the short (or long) names in this enum's order, separated by commas, or-when there are none.- Parameters:
flags- the flagslongNames- whether to use the long names- Returns:
- the rendered flags
-