Documentation
ยถ
Overview ยถ
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.
Directories
ยถ
| Path | Synopsis |
|---|---|
|
examples
module
|
|
|
roundtripper
command
|
|
|
Package proxymw holds interfaces and configuration to safeguard backend services from dynamic load
|
Package proxymw holds interfaces and configuration to safeguard backend services from dynamic load |
|
Package proxyutil handles parsing logic for proxymw configs
|
Package proxyutil handles parsing logic for proxymw configs |
|
proxyhttp
Package proxyhttp generates an http mux handler to servce requests using *httputil.ReverseProxy
|
Package proxyhttp generates an http mux handler to servce requests using *httputil.ReverseProxy |
Click to show internal directories.
Click to hide internal directories.