Skip to content

feat(pr-metrics): Instrument the delegated-agent attribution funnel#119036

Merged
giovanni-guidini merged 1 commit into
masterfrom
gio/obs/delegated-agent-attribution-funnel
Jul 7, 2026
Merged

feat(pr-metrics): Instrument the delegated-agent attribution funnel#119036
giovanni-guidini merged 1 commit into
masterfrom
gio/obs/delegated-agent-attribution-funnel

Conversation

@giovanni-guidini

Copy link
Copy Markdown
Contributor

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 under pr_metrics.delegated_agent.candidate tagged with provider + outcome, scoped to PRs plausibly opened by an agent so ordinary human PRs don't swamp it.

Also moves the existing seer_match metrics off the deprecated sentry_sdk.metrics.count onto sentry.utils.metrics.incr (the convention used elsewhere in pr_metrics), folding success/error into the same funnel. No behavior change.

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>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 6, 2026
@giovanni-guidini giovanni-guidini marked this pull request as ready for review July 6, 2026 08:26
@giovanni-guidini giovanni-guidini requested a review from a team July 6, 2026 08:26
@giovanni-guidini giovanni-guidini merged commit 25f534d into master Jul 7, 2026
68 checks passed
@giovanni-guidini giovanni-guidini deleted the gio/obs/delegated-agent-attribution-funnel branch July 7, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants