Skip to content

Commit

Permalink
Added track remaining setting (#412)
Browse files Browse the repository at this point in the history
* #601 Added track_remaining setting
  • Loading branch information
nastassia-dailidava authored Mar 20, 2024
1 parent 76427f4 commit 8e902af
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ class Threshold(var priority: String) {
var maxPendingRequests = 1024
var maxRequests = 1024
var maxRetries = 3
var trackRemaining = true
}

class Http2Properties {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ class EnvoyClustersFactory(
"HIGH" -> thresholdsBuilder.priority = RoutingPriority.HIGH
else -> thresholdsBuilder.priority = RoutingPriority.UNRECOGNIZED
}
thresholdsBuilder.setTrackRemaining(threshold.trackRemaining)
return thresholdsBuilder.build()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ internal class ClusterCircuitBreakerDefaultSettingsTest {
it.maxPendingRequests = 6
it.maxRequests = 7
it.maxRetries = 8
it.trackRemaining = true
}
)

Expand Down Expand Up @@ -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()
}
}

0 comments on commit 8e902af

Please sign in to comment.