[#743] Wire TrafficBreached telemetry event - #881
Merged
Conversation
Emits inside the transition_to_color(RED) guard in Tracker::Request so it fires exactly once per GREEN→RED flip. Adds TrafficControl#name to both built-in policies and the _TrafficControl port, consistent with TrafficRecovery#name.
Review price tag🟢 75 effective lines — about 9–23 min of focused review (based on 200–500 lines/hour). This is within the range where reviewers find the most issues per line, and small changes usually receive feedback the fastest. Spread across many files. This PR changes 10 files — more than about 9 in 10 PRs touch. Each extra file is another piece of context a reviewer has to load and hold at once. Why these numbers?These minutes are what careful defect-finding costs at 200–500 lines/hour — the rate review studies report, not how long a skim takes. "Effective lines" already exclude generated files and lockfiles. Treat the rates and the 200/400 thresholds as guardrails, not laws. |
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.
#743
TrafficBreachedfires when traffic control trips a light from green to red — the circuit just opened.RunCompletedwas the only wired event before this;TrafficBreachedwas defined but never emitted.state_store.transition_to_color(Color::RED)guard inTracker::Request#transition_to_red, so the event fires exactly once per GREEN→RED flip (same dedup invariant the existing notifier call relies on)emitter:intoTracker::Requestvia constructor — same patternRecoveryProbealready usesTrafficControl#nameto both built-in policies and the_TrafficControlport; namednameto matchTrafficRecovery#nameon the parallel interface rather than introducing a second term for the same concept. This is a breaking change for custom strategies duck-typing_TrafficControl— addingdef name = "your_policy"is the migration