feat(v10/cloudflare): Add Spotlight integration for local dev event forwarding - #22796
Merged
Merged
Conversation
…orwarding Backport of: #22490
Contributor
size-limit report 📦
|
Comment on lines
+70
to
+72
| failCount = 0; | ||
| } | ||
| }, |
Contributor
There was a problem hiding this comment.
Bug: The Spotlight integration's circuit breaker does not trigger on HTTP 4xx/5xx errors, only on network failures, preventing it from disabling requests to a failing but reachable sidecar.
Severity: LOW
Suggested Fix
Modify the fetch() success callback to check the response status. If the status is outside the 200-399 range, increment the failCount. This ensures that both network errors and HTTP error responses contribute to triggering the circuit breaker, aligning with its intended purpose of handling all failure modes.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: packages/cloudflare/src/integrations/spotlight.ts#L70-L72
Potential issue: The circuit-breaker logic in `spotlight.ts` is designed to stop sending
data to the Spotlight sidecar after repeated failures. However, it only increments the
`failCount` when the `fetch()` call is rejected (e.g., a network error). It does not
increment the count for successful `fetch` calls that result in an HTTP 4xx or 5xx
status code. As a result, if the sidecar is reachable but consistently returning errors,
the `failCount` will never increase, and the circuit breaker will fail to engage. This
leads to the integration continuously sending requests to a broken endpoint.
Did we get this right? 👍 / 👎 to inform future reviews.
JPeer264
force-pushed
the
backport-v10/cloudflare-spotlight-integration
branch
from
July 29, 2026 08:04
a1e4135 to
2d23219
Compare
andreiborza
approved these changes
Jul 29, 2026
This reverts commit dff8f1b.
JPeer264
force-pushed
the
backport-v10/cloudflare-spotlight-integration
branch
from
July 29, 2026 08:57
2d23219 to
0e163d1
Compare
JPeer264
enabled auto-merge (squash)
July 29, 2026 08:59
47 tasks
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.
Backport of: #22490
And reverted dev/prod bundle split, as
wrangleron its own doesn't support that