Enum Class ResponseFlag

java.lang.Object
java.lang.Enum<ResponseFlag>
org.microproxy.ResponseFlag
All Implemented Interfaces:
Serializable, Comparable<ResponseFlag>, Constable

public enum ResponseFlag extends Enum<ResponseFlag>
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.

  • Enum Constant Details

    • FAILED_LOCAL_HEALTH_CHECK

      public static final ResponseFlag FAILED_LOCAL_HEALTH_CHECK
      LH: a local health check failed. Not set by the proxy.
    • NO_HEALTHY_UPSTREAM

      public static final ResponseFlag NO_HEALTHY_UPSTREAM
      UH: no healthy upstream. Not set by the proxy.
    • UPSTREAM_REQUEST_TIMEOUT

      public static final ResponseFlag UPSTREAM_REQUEST_TIMEOUT
      UT: the server did not answer within the idle timeout.
    • LOCAL_RESET

      public static final ResponseFlag LOCAL_RESET
      LR: the proxy reset the stream itself.
    • UPSTREAM_REMOTE_RESET

      public static final ResponseFlag UPSTREAM_REMOTE_RESET
      UR: the server reset the stream or closed the connection mid-response.
    • UPSTREAM_CONNECTION_FAILURE

      public static final ResponseFlag UPSTREAM_CONNECTION_FAILURE
      UF: no connection could be made to the server, or its TLS handshake failed.
    • UPSTREAM_CONNECTION_TERMINATION

      public static final ResponseFlag UPSTREAM_CONNECTION_TERMINATION
      UC: the server closed the connection before its response head was complete.
    • UPSTREAM_OVERFLOW

      public static final ResponseFlag UPSTREAM_OVERFLOW
      UO: no server connection was available (the shared pool was exhausted).
    • NO_ROUTE_FOUND

      public static final ResponseFlag NO_ROUTE_FOUND
      NR: there was nowhere to send the request.
    • DELAY_INJECTED

      public static final ResponseFlag DELAY_INJECTED
      DI: the request was delayed on purpose. Not set by the proxy.
    • FAULT_INJECTED

      public static final ResponseFlag FAULT_INJECTED
      FI: a fault was injected. Not set by the proxy.
    • RATE_LIMITED

      public static final ResponseFlag RATE_LIMITED
      RL: the request was refused by a rate or concurrency limit.
    • UNAUTHORIZED_EXTERNAL_SERVICE

      public static final ResponseFlag UNAUTHORIZED_EXTERNAL_SERVICE
      UAEX: the client was refused by the proxy authenticator.
    • RATE_LIMIT_SERVICE_ERROR

      public static final ResponseFlag RATE_LIMIT_SERVICE_ERROR
      RLSE: the rate-limit service failed. Not set by the proxy.
    • DOWNSTREAM_CONNECTION_TERMINATION

      public static final ResponseFlag DOWNSTREAM_CONNECTION_TERMINATION
      DC: the client went away before the response was complete.
    • UPSTREAM_RETRY_LIMIT_EXCEEDED

      public static final ResponseFlag UPSTREAM_RETRY_LIMIT_EXCEEDED
      URX: every route was tried (with backoff between chained proxies) and failed.
    • STREAM_IDLE_TIMEOUT

      public static final ResponseFlag STREAM_IDLE_TIMEOUT
      SI: the exchange, tunnel or flow sat idle for the idle timeout.
    • INVALID_ENVOY_REQUEST_HEADERS

      public static final ResponseFlag INVALID_ENVOY_REQUEST_HEADERS
      IH: the request had invalid proxy-specific headers. Not set by the proxy.
    • DOWNSTREAM_PROTOCOL_ERROR

      public static final ResponseFlag DOWNSTREAM_PROTOCOL_ERROR
      DPE: the client's request was malformed, refused as such, or too large.
    • UPSTREAM_MAX_STREAM_DURATION_REACHED

      public static final ResponseFlag UPSTREAM_MAX_STREAM_DURATION_REACHED
      UMSDR: the upstream stream reached its maximum duration. Not set by the proxy.
    • RESPONSE_FROM_CACHE_FILTER

      public static final ResponseFlag RESPONSE_FROM_CACHE_FILTER
      RFCF: served by a cache filter. Not set by the proxy, which says cache in the details.
    • NO_FILTER_CONFIG_FOUND

      public static final ResponseFlag NO_FILTER_CONFIG_FOUND
      NFCF: no filter configuration was found. Not set by the proxy.
    • DURATION_TIMEOUT

      public static final ResponseFlag DURATION_TIMEOUT
      DT: the request exceeded its maximum duration. Not set by the proxy.
    • UPSTREAM_PROTOCOL_ERROR

      public static final ResponseFlag UPSTREAM_PROTOCOL_ERROR
      UPE: the server's response was malformed.
    • NO_CLUSTER_FOUND

      public static final ResponseFlag NO_CLUSTER_FOUND
      NC: no upstream cluster was found. Not set by the proxy.
    • OVERLOAD_MANAGER

      public static final ResponseFlag OVERLOAD_MANAGER
      OM: the request was refused under overload. Not set by the proxy.
    • DNS_RESOLUTION_FAILED

      public static final ResponseFlag DNS_RESOLUTION_FAILED
      DF: the server's name did not resolve.
    • DROP_OVERLOAD

      public static final ResponseFlag DROP_OVERLOAD
      DO: the request was dropped under overload. Not set by the proxy.
    • DOWNSTREAM_REMOTE_RESET

      public static final ResponseFlag DOWNSTREAM_REMOTE_RESET
      DR: the client reset its HTTP/2 or HTTP/3 stream.
    • UNCONDITIONAL_DROP_OVERLOAD

      public static final ResponseFlag UNCONDITIONAL_DROP_OVERLOAD
      UDO: the request was dropped unconditionally under overload. Not set by the proxy.
  • Method Details

    • values

      public static ResponseFlag[] 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

      public static ResponseFlag valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • code

      public String code()
      Returns Envoy's short code, such as UF.
      Returns:
      Envoy's short code, such as UF
    • longName

      public String longName()
      Returns Envoy's long name, such as UpstreamConnectionFailure.
      Returns:
      Envoy's long name, such as UpstreamConnectionFailure
    • of

      public static ResponseFlag of(String name)
      The flag with the short code or long name name, 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

      public static String render(Set<ResponseFlag> flags, boolean longNames)
      Renders flags as Envoy does: the short (or long) names in this enum's order, separated by commas, or - when there are none.
      Parameters:
      flags - the flags
      longNames - whether to use the long names
      Returns:
      the rendered flags