feat: track interception-hook dispatches in telemetry - #6805
Merged
Conversation
`HookDispatchedEvent` was already emitted from the dispatcher but never landed in Feature Usage. Wire it through `hook_dispatched_span` so hook adoption and abort outcomes (e.g. policy checks) show up in the same ClickHouse aggregation as other features.
📝 WalkthroughWalkthroughThis PR adds telemetry tracking for hook dispatch events. A new ChangesHook dispatch telemetry tracking
Sequence Diagram(s)sequenceDiagram
participant HookSystem
participant EventBus
participant EventListener
participant Telemetry
HookSystem->>EventBus: emit HookDispatchedEvent(interception_point, outcome)
EventBus->>EventListener: dispatch HookDispatchedEvent
EventListener->>Telemetry: hook_dispatched_span(interception_point, outcome)
Telemetry->>Telemetry: record hooks:<interception_point> usage
alt outcome == "aborted"
Telemetry->>Telemetry: record hooks:aborted usage
end
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
lorenzejay
approved these changes
Aug 4, 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.
HookDispatchedEvent was already emitted from the dispatcher but never reached Feature Usage, so hook adoption and policy aborts were invisible in ClickHouse. This adds hook_dispatched_span and wires the event listener so each dispatch counts as hooks:, with hooks:aborted on abort outcomes.