fix(code-review): Disable direct-to-seer ghe on-prem flow#105985
Merged
fix(code-review): Disable direct-to-seer ghe on-prem flow#105985
Conversation
vaind
approved these changes
Jan 9, 2026
suejung-sentry
pushed a commit
that referenced
this pull request
Jan 9, 2026
(Note a previous [version](#105587) of this was [reverted](4dd9584). This is the un-revert-the-revert PR that avoids the sentry [issue](https://sentry.sentry.io/issues/7173671530/?project=1&query=%21error.type%3AThreadLeakAssertionError%20code_review%20is%3Aunresolved&referrer=issue-stream) that arose by waiting for this [fix](#105985) to disable ghe on-prem to go in first.) ___________ Unifies the metrics structure for what we can use across all our code review metrics handlers. Updates check_run, issue_comment, and task scheduling to emit the handler-stage funnel metrics: * `sentry.seer.code_review.webhook.received` * `sentry.seer.code_review.webhook.filtered` (tagged with `reason`: CodeReviewFilteredReason) * `sentry.seer.code_review.webhook.enqueued` * `sentry.seer.code_review.webhook.error` (tagged with `error_type`: CodeReviewErrorType) Ensures all handler metrics share common tags: * `github_event`, `github_event_action` (so we can track like pull_request.opened vs. issue_comment.created) Task execution metrics stay as-is in webhooks/task.py (`sentry.seer.code_review.task.error`, `sentry.seer.code_review.task.e2e_latency`) Closes [CW-105](https://linear.app/getsentry/issue/CW-105/standardize-webhook-metrics-and-helpers-for-code-review) I plan to add these Datadog dashboards ``` # Total Webhooks Received (24h) sum:sentry.seer.code_review.webhook.received{*}.as_count() # Enqueue Rate (sum:sentry.seer.code_review.webhook.enqueued{*}.as_count() / sum:sentry.seer.code_review.webhook.received{*}.as_count()) * 100 # Avg E2E Latency (ms) avg:sentry.seer.code_review.task.e2e_latency{*} # Error Count (24h) sum:sentry.seer.code_review.webhook.error{*}.as_count() + sum:sentry.seer.code_review.task.error{*}.as_count() ``` ``` Processing Funnel (Top List or Funnel Chart) sum:sentry.seer.code_review.webhook.received{*} by {github_event,github_event_action}.as_count() sum:sentry.seer.code_review.webhook.enqueued{*} by {github_event,github_event_action}.as_count() sum:sentry.seer.code_review.task.completed{*} by {github_event,github_event_action}.as_count() ``` ``` Volume by Event Type and Action (Timeseries) # By event type sum:sentry.seer.code_review.webhook.received{*} by {github_event}.as_count() # By specific action (e.g., check_run rerequests) sum:sentry.seer.code_review.webhook.received{github_event:check_run,github_event_action:rerequested}.as_count() # By issue_comment created sum:sentry.seer.code_review.webhook.received{github_event:issue_comment,github_event_action:created}.as_count() ``` ``` E2E Latency Distribution (Heatmap) avg:sentry.seer.code_review.task.e2e_latency{*} Latency Percentiles (Timeseries) p50:sentry.seer.code_review.task.e2e_latency{*} p95:sentry.seer.code_review.task.e2e_latency{*} p99:sentry.seer.code_review.task.e2e_latency{*} Handler Errors by Type (Top List) sum:sentry.seer.code_review.webhook.error{*} by {error_type}.as_count() Task Errors by Exception Type (Top List) sum:sentry.seer.code_review.task.error{*} by {error_status}.as_count() Filter Reasons (Pie Chart) sum:sentry.seer.code_review.webhook.filtered{*} by {reason}.as_count() ``` this is also a draft [doc](https://www.notion.so/sentry/Code-Review-Observability-2dc8b10e4b5d80ef87e6c8a28cd820a7?source=copy_link) started that I can update once we're stabilized
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
GitHub Enterprise on-prem webhooks are currently flowing through our new stuff for the overwatch migration project (getting filtered out, but still getting further than we want, so add this additional check upstream).
inheritance chain
I saw an unexpected sentry issue with this PR because we assumed the github_event was
GitHubWebhookTypehere, but actually it's of type string for github enterprise on-prem inherited provider code here. So technically the type hint was wrong in the case of ghe on-prem.When we go to support GitHub Enterprise on-prem provider we can make any necessary adjustments there and anywhere else needed to fully support that flow end-to-end.