gofr icon indicating copy to clipboard operation
gofr copied to clipboard

Rate limiter HTTP

Open archit-2003 opened this issue 5 months ago • 3 comments

Problem

While GoFr supports retries, OAuth, circuit breakers, and health checks for interservice HTTP calls, it lacks built-in rate limiting. This can lead to downstream abuse or noisy-neighbor issues in large distributed systems.


Goal

Introduce optional rate limiting support in interservice HTTP calls.

  • Add a RateLimiterConfig struct as an optional parameter to AddHTTPService.

  • Allow configuration of:

    • RequestsPerSecond
    • Burst
  • Apply rate limiting per target service.


Requirements

  • Logging: Emit a log when rate limits are triggered.
  • OpenTelemetry tracing: Trace rate-limited requests.
  • Prometheus metrics: Emit rate-limiting metrics for observability.

archit-2003 avatar Jul 04 '25 18:07 archit-2003

I’m currently contributing to this as part of the GoFr Summer of Code 2025. Kindly assign this issue to me. Thank you!

archit-2003 avatar Jul 04 '25 18:07 archit-2003

Sure! Assigning this issue. This issue has been picked up once and there has also been an existing issue made prior to this. I will be also linking them for your/other reviewers' reference.

coolwednesday avatar Jul 07 '25 09:07 coolwednesday

I am working on this issue and have raised pr #2263 for the same.

Umang01-hash avatar Sep 22 '25 07:09 Umang01-hash