[log] Add debug logging to circuit breaker - #4582
Merged
Merged
Conversation
Add 4 meaningful debug log calls to internal/server/circuit_breaker.go: - newCircuitBreaker: log creation with threshold and cooldown config - Allow (HALF-OPEN): log when probe is already in flight, rejecting request - RecordSuccess: log when consecutive error count is reset to 0 - parseRateLimitResetFromText: log when a reset time is parsed from text These log calls improve observability for troubleshooting rate-limit circuit breaker behaviour without duplicating existing operational logs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds additional debug-level observability to the server rate-limit circuit breaker (internal/server/circuit_breaker.go) using the existing server:circuit_breaker debug logger namespace, to help diagnose configuration and state transitions during rate-limiting scenarios.
Changes:
- Log circuit breaker creation (server ID, threshold, cooldown) at initialization.
- Log additional circuit breaker state/flow details: HALF-OPEN probe rejection, consecutive error reset on success, and parsed rate-limit reset timing from error text.
Show a summary per file
| File | Description |
|---|---|
| internal/server/circuit_breaker.go | Adds 4 debug log lines to improve visibility into circuit breaker creation, HALF-OPEN behavior, error counter resets, and parsed reset times. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 0
This was referenced Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds 4 focused debug log calls to
internal/server/circuit_breaker.gousing the existinglogCircuitBreakerlogger (server:circuit_breakernamespace).Changes
File modified:
internal/server/circuit_breaker.goNew logging calls
newCircuitBreakerserverID,threshold, andcooldownso you can see CB config at startupAllow(HALF-OPEN branch)RecordSuccessparseRateLimitResetFromTextValidation
go build ./...✅go vet ./...✅go test ./internal/server/...✅Enable these logs
Warning
The following domain was blocked by the firewall during workflow execution:
releaseassets.githubusercontent.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.