chore(gateway): Add logs RateLimiter for Gateway#1472
Conversation
A part of "BURST:REPLENISHMENTS_PER_SECOND" defines rate limiter config for Token/Bucket throttler in the Gatewy. Signed-off-by: Sergey Matov <sergey.matov@githedgehog.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR adds optional token-bucket rate limiting for gateway logs. A new ChangesGateway Log Rate Limiting
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
🚀 Temp artifacts published: |
A part of "BURST:REPLENISHMENTS_PER_SECOND" defines rate limiter config for Token/Bucket throttler in the Gatewy.
Overview
Adds log rate limiting support to the Gateway API, enabling token-bucket-style throttling of log messages through a new
GatewayLogRateLimitconfiguration type.Changes
Core Implementation
GatewayLogRateLimittype withBurst(uint32) andReplenishPerSecond(uint32) fields inapi/gateway/v1alpha1/gateway_types.gorateLimitfield toGatewayLogsstruct(*Gateway).Validatemethod to validate rate limit configuration, rejecting configurations where eitherburstorreplenishPerSecondis zeroTesting
TestGatewayValidatecovering:Burst: 50,ReplenishPerSecond: 5)Generated Code
GatewayLogRateLimitinzz_generated.deepcopy.goGatewayLogs.DeepCopyIntoto handle the newRateLimitfieldAPI and Schema
config/crd/bases/gateway.githedgehog.com_gateways.yamlfor Gateway CRDconfig/crd/bases/gwint.githedgehog.com_gatewayagents.yamlfor GatewayAgent CRDdocs/api.mdwithGatewayLogRateLimittype definition and usageScope
+97 lines across 6 files, implementing the foundational configuration for log rate limiting in the Gateway.