diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dc168411..f60061aa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ Lists all changes with user impact. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). +## [0.20.12] +### Changed +- Added "trackRemaining" flag to enable possibility of tracking additional circuit breaker metrics +- ## [0.20.11] ### Changed - Implemented adding a header for locality weighted load balancing diff --git a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotProperties.kt b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotProperties.kt index 913e8ba43..b85ffe283 100644 --- a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotProperties.kt +++ b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotProperties.kt @@ -323,6 +323,7 @@ class Threshold(var priority: String) { var maxPendingRequests = 1024 var maxRequests = 1024 var maxRetries = 3 + var trackRemaining = true } class Http2Properties { diff --git a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt index f06ab030d..846b6381c 100644 --- a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt +++ b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/resource/clusters/EnvoyClustersFactory.kt @@ -567,6 +567,7 @@ class EnvoyClustersFactory( "HIGH" -> thresholdsBuilder.priority = RoutingPriority.HIGH else -> thresholdsBuilder.priority = RoutingPriority.UNRECOGNIZED } + thresholdsBuilder.setTrackRemaining(threshold.trackRemaining) return thresholdsBuilder.build() } diff --git a/envoy-control-tests/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/ClusterCircuitBreakerDefaultSettingsTest.kt b/envoy-control-tests/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/ClusterCircuitBreakerDefaultSettingsTest.kt index 35e76a3ce..d9b35f66a 100644 --- a/envoy-control-tests/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/ClusterCircuitBreakerDefaultSettingsTest.kt +++ b/envoy-control-tests/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/ClusterCircuitBreakerDefaultSettingsTest.kt @@ -27,6 +27,7 @@ internal class ClusterCircuitBreakerDefaultSettingsTest { it.maxPendingRequests = 6 it.maxRequests = 7 it.maxRetries = 8 + it.trackRemaining = true } ) @@ -59,9 +60,13 @@ internal class ClusterCircuitBreakerDefaultSettingsTest { // when val maxRequestsSetting = envoy.container.admin().circuitBreakerSetting("echo", "max_requests", "default_priority") val maxRetriesSetting = envoy.container.admin().circuitBreakerSetting("echo", "max_retries", "high_priority") + val remainingPendingMetric = envoy.container.admin().statValue("cluster.echo.circuit_breakers.default.remaining_pending") + val remainingRqMetric = envoy.container.admin().statValue("cluster.echo.circuit_breakers.default.remaining_rq") // then assertThat(maxRequestsSetting).isEqualTo(3) assertThat(maxRetriesSetting).isEqualTo(8) + assertThat(remainingPendingMetric).isNotNull() + assertThat(remainingRqMetric).isNotNull() } }