-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Package throttleproxy provides an adaptive backpressure proxy mechanism for dynamically managing | ||
// traffic and protecting backend services using Prometheus metrics. | ||
// | ||
// Usage Example: | ||
// | ||
// config := proxymw.BackpressureConfig{ | ||
// EnableBackpressure: true, | ||
// BackpressureQueries: []BackpressureQuery{ | ||
// { | ||
// Query: `sum(rate(http_server_errors_total[5m]))`, | ||
// Name: "http_error_rate" | ||
// WarningThreshold: 0.5, | ||
// EmergencyThreshold: 0.8, | ||
// } | ||
// }, | ||
// CongestionWindowMin: 10, | ||
// CongestionWindowMax: 100, | ||
// } | ||
// | ||
// Use Cases: | ||
// - Protecting microservices from traffic spikes | ||
// - Preventing cascading failures | ||
// - Maintaining system stability under unpredictable load | ||
// | ||
// The package supports both server-side HTTP proxy and client-side RoundTripper | ||
// implementations, providing flexible integration options. | ||
package main // import "github.com/kevindweb/throttle-proxy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters