Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Allow users to define the week start day for week-based rate limit setups

Closed Beginner friendly
#1,260 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

@divakaivan is already working on this.

Since Oct 7, 2026.

  • #1263 by @divakaivan — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
backend

Research direction

The change follows the existing pattern for calendar month rate limits. First review the USE_CALENDAR_MONTH_RATE_LIMIT implementation in src/utils/time.go and the calendar branch of CacheKeyGenerator.GenerateCacheKey in src/limiter/cache_key.go to understand the expected structure. Add the new WEEK_RATE_LIMIT_START_DAY environment variable, update the weekly bucket calculation to snap to the configured weekday instead of the Unix epoch Thursday boundary, and add tests for both default and custom start day scenarios.

Written by the indexing model from the issue text.

Description

BackendTrafficPolicy now supports Week as a RateLimitUnit (see https://github.com/envoyproxy/gateway/pull/9693).

This means the weekly rate-limit window is anchored to Unix epoch boundaries. As a result, the window resets on Thursday 00:00 UTC - date/time users cannot modify.

Root

in envoyproxy/ratelimit, the cache key bucket is computed as

// src/limiter/cache_key.go
divider := utils.UnitToDivider(limit.Limit.Unit) // 604800 for WEEK
bucketStart = (now / divider) * divider

Unix epoch 0 (1970-01-01) was a thursday so integer division snaps to a Thursday.

Proposal

(after discussing the issue during 5th Oct envoy weekly meeting)

This is already solved for MONTH. The ratelimit service has USE_CALENDAR_MONTH_RATE_LIMIT (env flag), MonthStartUnix() / MonthExpirationSeconds(), helpers in src/utils/time.go here and a calendar branch in CacheKeyGenerator.GenerateCacheKey

  • Add a single env var WEEK_RATE_LIMIT_RESET_DAY to the ratelimit service
  • When unset (default): legacye behaviour is preserved - weekly windows continue to reset on Thursday
  • When set to a weekday (Monday... Sunday) - the weekly rate-limit windows reset on that weekday at 00:00 UTC

The behaviour is similarly designed to the USE_CALENDAR_MONTH_RATE_LIMIT optional env var


Originally: https://github.com/envoyproxy/gateway/issues/10181
But closed and opened this upon the discussions during the 5th Oct meeting

The discussions around the feature were positive - I will look to raise a PR in the coming days.

Dominant language
Go
Stars
2.7k
Forks
544
Avg merge
4d 20h
Merged PRs (30d)
10

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from envoyproxy/ratelimit

All issues in envoyproxy/ratelimit

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.