ref(seer): Remove verbose debug_log instrumentation from GitLab webhooks#118192
Draft
billyvg wants to merge 4 commits into
Draft
ref(seer): Remove verbose debug_log instrumentation from GitLab webhooks#118192billyvg wants to merge 4 commits into
billyvg wants to merge 4 commits into
Conversation
Drop the per-step debug_log breadcrumbs (handler_started, processor_started, dispatching_processors, scheduling_seer_task, and similar) from the GitLab merge_request and note webhook paths. These were added for early rollout debugging and are now noise; the meaningful filter/error signals remain via record_webhook_filtered/record_webhook_handler_error metrics and the debug_log calls that carry diagnostic context (missing data, preflight denials, dedup skips) are kept. No behavior change. Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you remove the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
…move-debug-log-instrumentation # Conflicts: # src/sentry/seer/code_review/webhooks/merge_request.py # src/sentry/seer/code_review/webhooks/seat_tracking.py
…smatch Follow-up to the debug_log cleanup, informed by 30d prod log volumes: - Remove preflight_denied / note.preflight_denied INFO logs (2.5M/30d, 88% a single org_not_eligible_for_code_review reason) — fully redundant with the adjacent record_webhook_filtered(denial_reason) metric. - Remove tracking_contributor_seat (644K/30d) — a pre-call breadcrumb bracketing the same track_contributor_seat() as the already-removed contributor_seat_tracked log, redundant with the record_contributor_action metric. - actor_author_mismatch (659K/30d): drop WARNING -> INFO and enrich the extra with event_kind, merge_request_state, and actor_username. The mismatch is benign by design (reviewers approve, maintainers merge, bots push updates: actor != author), so it is not warning-worthy, and the added context tells a benign mismatch apart from a real anomaly without a second lookup. GitLab payloads expose the author only as a numeric id, so the author side stays an id.
Drop the actor_author_mismatch debug_log (and the _actor_author_mismatch_extra helper) from both seat-tracking processors. Prod showed 659K/30d, and the mismatch is expected traffic by design -- a reviewer approving, a maintainer merging, or a bot pushing an update all legitimately arrive with actor != author (action breakdown: update 319K, approved/approval 138K, merge 49K). Only the seat-stage processor is gated to action=="open"; the action-stage processor (the 515K bulk) fires on every whitelisted action, which is where the volume comes from. The 'actor != author -> skip seeding' guard stays -- it's a real correctness check (seeding would store the actor's username against the author-keyed row). Only the log call is removed; the skip is now silent.
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.
Summary
Removes the per-step
debug_logbreadcrumbs that were added for early GitLab Seer code-review rollout debugging and are now just noise:handler_started,processor_started,dispatching_processors,scheduling_seer_task,preflight_passed, and similar (47 deletions across the merge_request, note, and seat-tracking paths).Kept:
record_webhook_filtered/record_webhook_handler_errormetrics (the queryable funnel signal).debug_logcalls that carry real diagnostic context — missing author data, preflight denials, dedup skips, missing-org.No behavior change — pure logging cleanup.
Testing
prek(ruff/flake8/mypy) clean; GitLab webhook + seer code-review webhook suites pass (113 tests; the oneopened_atfailure under--reuse-dbis a stale-DB artifact and passes on a fresh DB).