Problem
Rate limit status is tracked internally (ScopedRateLimitTracker) but not exposed to admins. When sync slows down due to rate limits, admins have no visibility into the cause.
Proposed Solution
Expose rate limit status via API endpoint so admins can see current limits, reset times, and health thresholds.
Scope
In scope:
- Current rate limit remaining and total
- Reset timestamp
- Health state (healthy/low/critical)
- Circuit breaker state (if applicable)
Out of scope:
- Historical rate limit usage
- Per-endpoint breakdown
- Rate limit alerts/notifications
Technical Notes
Data source: ScopedRateLimitTracker already tracks:
- Remaining points
- Total limit
- Reset time
- Health thresholds (500=low, 100=critical)
Proposed endpoint:
GET /api/workspaces/{slug}/sync/rate-limit
Response: {
"provider": "GITHUB" | "GITLAB",
"remaining": 4500,
"limit": 5000,
"resetAt": "2025-02-04T11:00:00Z",
"health": "HEALTHY" | "LOW" | "CRITICAL",
"circuitBreakerOpen": false
}
Health thresholds (from existing code):
HEALTHY: remaining > 500
LOW: 100 < remaining <= 500
CRITICAL: remaining <= 100
GitLab differences:
- REST API: 2000 requests/minute (header:
RateLimit-Remaining)
- GraphQL: 100 points/minute (different accounting)
- May need separate tracking for REST vs GraphQL
Files to modify:
workspace/sync/SyncStatusController.java — Add rate limit endpoint
- Create
workspace/sync/dto/RateLimitStatusDTO.java
Acceptance Criteria
Problem
Rate limit status is tracked internally (
ScopedRateLimitTracker) but not exposed to admins. When sync slows down due to rate limits, admins have no visibility into the cause.Proposed Solution
Expose rate limit status via API endpoint so admins can see current limits, reset times, and health thresholds.
Scope
In scope:
Out of scope:
Technical Notes
Data source:
ScopedRateLimitTrackeralready tracks:Proposed endpoint:
Health thresholds (from existing code):
HEALTHY: remaining > 500LOW: 100 < remaining <= 500CRITICAL: remaining <= 100GitLab differences:
RateLimit-Remaining)Files to modify:
workspace/sync/SyncStatusController.java— Add rate limit endpointworkspace/sync/dto/RateLimitStatusDTO.javaAcceptance Criteria
ScopedRateLimitTracker(no new tracking)