feat(seer): Add lightweight RCA clustering endpoint integration#112229
feat(seer): Add lightweight RCA clustering endpoint integration#112229
Conversation
Call Seer's new /v0/issues/supergroups/cluster-lightweight endpoint on new issue creation, gated per-org via sentry-options. This sends issue event data to Seer for lightweight root cause analysis and clustering into supergroups. Also renames the existing explorer-based lightweight RCA files to explorer_lightweight_rca to avoid confusion with the new direct endpoint-based clustering approach. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
a949cd4 to
1b7c082
Compare
Serialized event data from EventSerializer can contain non-string dict keys (integer keys in _meta.entries). Without this option orjson.dumps raises TypeError.
Backend Test FailuresFailures on
|
Without this registration the task won't be discovered by the taskworker in production.
Backend Test FailuresFailures on
|
src/sentry/options/defaults.py
Outdated
| ) | ||
|
|
||
| # Supergroups / Lightweight RCA | ||
| register( |
There was a problem hiding this comment.
does it make sense to duplicate the options between here and seer? i thought the original plan was to have seer do this check
There was a problem hiding this comment.
yea I was conflicted about it, I think that now I got options in Seer I can have protections there, but I also dont want to queue tasks for all issues for nothing, seems very wasteful... and now I can basically have both be controlled by the same repo so I think its ok to protect from both sides using same config
There was a problem hiding this comment.
we could just do the check only in sentry the? not sure it makes sense to duplicate the options, especially if the options have exactly the same name + purpose
This option is used on the Seer side, not in Sentry. Remove it until it's actually needed here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6f9d2d1. Configure here.
| """ | ||
| enabled_orgs: list[int] = options.get("supergroups.lightweight-enabled-orgs") | ||
| if group.organization.id not in enabled_orgs: | ||
| return |
There was a problem hiding this comment.
Duplicated org enablement check increases maintenance risk
Low Severity
The supergroups.lightweight-enabled-orgs option check is duplicated in kick_off_lightweight_rca_cluster and trigger_lightweight_rca_cluster. The check in trigger_lightweight_rca_cluster is redundant since kick_off_lightweight_rca_cluster already performs this gating before dispatching the task. This duplication creates a maintenance risk if the logic changes, potentially leading to inconsistencies.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 6f9d2d1. Configure here.
Backend Test FailuresFailures on
|
The instrumented_task decorator requires `namespace` not `taskworker_namespace`, and doesn't accept `queue` or `max_retries`.
GroupEvent.group is typed as non-optional, so the None check is unreachable and mypy flags it.


Integrate Seer's new
/v0/issues/supergroups/cluster-lightweightendpoint for lightweight root cause analysis and supergroup clustering.When a new error issue is created, if the org is in the
supergroups.lightweight-enabled-orgssentry-option, we send the issue's event data to Seer. Seer generates a lightweight RCA via a single LLM call and clusters the issue into supergroups based on embedding similarity. This is separate from the existing Explorer-based agentic RCA flow.Changes:
supergroups.active-rca-sourceandsupergroups.lightweight-enabled-orgssentry-optionsLightweightRCAClusterRequesttype andmake_lightweight_rca_cluster_request()API functiontrigger_lightweight_rca_cluster()core function and Celery taskkick_off_lightweight_rca_clusterpipeline step in post_process for new error issueslightweight_rca.py→explorer_lightweight_rca.pyto clarify it's the Explorer-based flow