Repository: envoyproxy/envoy
File: api/envoy/extensions/upstreams/http/v3/http_protocol_options.proto (Protocol Buffers)

Code before:
  //
  // These filters will be applied for all HTTP streams which flow through this
  // cluster. Unlike downstream HTTP filters, they will *not* be applied to terminated CONNECT requests.
  //
  // If using upstream HTTP filters, please be aware that local errors sent by
  // upstream HTTP filters will not trigger retries, and local errors sent by
  // upstream HTTP filters will count as a final response if hedging is configured.
  // [#extension-category: envoy.filters.http.upstream]
  repeated filters.network.http_connection_manager.v3.HttpFilter http_filters = 6;

  // Configuration options for Unified Header Validation (UHV).
  // UHV is an extensible mechanism for checking validity of HTTP responses.
  //
  // [#comment:TODO(yanavlasov): Make it a link to the default header validator doc when it becomes visible.]
  // Leaving this field unspecified, selects the default header validator ``envoy.http.header_validators.envoy_default``.
  //
  // [#not-implemented-hide:]
  // [#extension-category: envoy.http.header_validators]
  config.core.v3.TypedExtensionConfig header_validation_config = 7;

  message HttpEvents {
    // Matcher for response headers.
    config.common.matcher.v3.MatchPredicate match = 1 [(validate.rules).message = {required: true}];

    // Determines if matching indicate error or non-error. Defaults to false (error).
    bool success_on_match = 2;
  }

  // List of matchers for response headers along with codes to be reported to outlier detection.
  // The first matcher which returns matching success is applied.
  repeated HttpEvents outlier_detection = 8;
}


Review comment (suggestion):
If we agree the outlier detection matcher here should generate a boolean result, then:

1. the `success_on_match` seem make no sense. You only need to define that if match then signify error. This would simlify the API.
2. We also needn't repeated `HttpEvents`. Because the `MatchPredicate` self support or_match, and_match, not_match. Single `config.common.matcher.v3.MatchPredicate` is good enough for this task.



Code after:

  // Optional HTTP filters for the upstream HTTP filter chain.
  //
  // .. note::
  //   Upstream HTTP filters are currently in alpha.
  //
  //
  // These filters will be applied for all HTTP streams which flow through this
  // cluster. Unlike downstream HTTP filters, they will *not* be applied to terminated CONNECT requests.
  //
  // If using upstream HTTP filters, please be aware that local errors sent by
  // upstream HTTP filters will not trigger retries, and local errors sent by
  // upstream HTTP filters will count as a final response if hedging is configured.
  // [#extension-category: envoy.filters.http.upstream]
  repeated filters.network.http_connection_manager.v3.HttpFilter http_filters = 6;

  // Configuration options for Unified Header Validation (UHV).
  // UHV is an extensible mechanism for checking validity of HTTP responses.
  //
  // [#comment:TODO(yanavlasov): Make it a link to the default header validator doc when it becomes visible.]
  // Leaving this field unspecified, selects the default header validator ``envoy.http.header_validators.envoy_default``.
  //
  // [#not-implemented-hide:]
  // [#extension-category: envoy.http.header_validators]
  config.core.v3.TypedExtensionConfig header_validation_config = 7;

  // Defines http specific outlier detection parameters.
  OutlierDetection outlier_detection = 8;
}