feat(pr-metrics): Instrument the delegated-agent attribution funnel#119036
Merged
giovanni-guidini merged 1 commit intoJul 7, 2026
Conversation
The webhook path that matches a freshly-opened PR to a Seer-delegated coding-agent launch dropped PRs at several silent early returns: no provider hint (the load-bearing case for Claude, which opens PRs as the Sentry app so the ``claude/`` branch prefix is its only signal), no org integration, no resolved groups, and bad repo metadata. None of these emitted anything, so the biggest failure modes were invisible. Record every terminal stage under a single ``pr_metrics.delegated_agent .candidate`` counter tagged with provider + outcome, scoped to PRs plausibly opened by an agent (a provider hint or app authorship) so ordinary human PRs don't swamp it. This makes the drop-off funnel queryable end to end, from candidate detection through the Seer match request. Also migrate the existing seer_match metrics off the deprecated ``sentry_sdk.metrics.count`` onto ``sentry.utils.metrics.incr`` — the convention used everywhere else in pr_metrics — folding success and error into the same funnel so the whole path reports through one metric. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
joseph-sentry
approved these changes
Jul 6, 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.
Adds a funnel counter to the webhook path that matches a freshly-opened PR to a Seer-delegated coding-agent launch, so we can tell why some PRs never get a
seer_delegated:*attribution.Today that path drops PRs at several silent early returns — no provider hint (the main case for Claude, which opens PRs as the Sentry app so the
claude/branch prefix is its only signal), no org integration, no resolved groups, bad repo metadata — none of which emit anything. Every terminal stage now records underpr_metrics.delegated_agent.candidatetagged withprovider+outcome, scoped to PRs plausibly opened by an agent so ordinary human PRs don't swamp it.Also moves the existing
seer_matchmetrics off the deprecatedsentry_sdk.metrics.countontosentry.utils.metrics.incr(the convention used elsewhere in pr_metrics), folding success/error into the same funnel. No behavior change.