[Bandwidth-Limit] Add response trailers for bandwidth delay (#18267)

- Add response trailers for the bandwidth limit filter delays.
- Add new metric request_enforced and response_enforced.
- Change the following metrics type from Gauge to Counter (request_incoming_size, response_incoming_size, request_allowed_size, response_allowed_size) to better calculate the network bytes per second.

This is useful when downstream want to understand how much delays that is caused by bandwidth limit filter.

Risk Level: Low
Testing: UT added.
Docs Changes: Updated.
Release Notes: Added.

Signed-off-by: gayang <gayang@microsoft.com>

Mirrored from https://github.com/envoyproxy/envoy @ 8b8ece8adb8c9282cbd9405151993fa1bc5cebee
pull/626/head
data-plane-api(Azure Pipelines) 3 years ago
parent bd6e31fe1f
commit ee95d36f0c
  1. 17
      envoy/extensions/filters/http/bandwidth_limit/v3/bandwidth_limit.proto

@ -19,7 +19,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
// Bandwidth limit :ref:`configuration overview <config_http_filters_bandwidth_limit>`.
// [#extension: envoy.filters.http.bandwidth_limit]
// [#next-free-field: 6]
// [#next-free-field: 8]
message BandwidthLimit {
// Defines the mode for the bandwidth limit filter.
// Values represent bitmask.
@ -66,4 +66,19 @@ message BandwidthLimit {
// Runtime flag that controls whether the filter is enabled or not. If not specified, defaults
// to enabled.
config.core.v3.RuntimeFeatureFlag runtime_enabled = 5;
// Enable response trailers.
//
// .. note::
//
// * If set true, the response trailers *bandwidth-request-delay-ms* and *bandwidth-response-delay-ms* will be added, prefixed by *response_trailer_prefix*.
// * bandwidth-request-delay-ms: delay time in milliseconds it took for the request stream transfer.
// * bandwidth-response-delay-ms: delay time in milliseconds it took for the response stream transfer.
// * If :ref:`enable_mode <envoy_v3_api_field_extensions.filters.http.bandwidth_limit.v3.BandwidthLimit.enable_mode>` is DISABLED or REQUEST, the trailers will not be set.
// * If both the request and response delay time is 0, the trailers will not be set.
//
bool enable_response_trailers = 6;
// Optional The prefix for the response trailers.
string response_trailer_prefix = 7;
}

Loading…
Cancel
Save