Skip to content

feat(seer): Add investigation entrypoint and operator scaffolding - #126900

Merged
alexsohn1126 merged 1 commit into
masterfrom
alexsohn/cw-2134-investigation-entrypoint-scaffold
Oct 14, 2026
Merged

alexsohn1126 merged 1 commit into
masterfrom
alexsohn/cw-2134-investigation-entrypoint-scaffold

Conversation

@alexsohn1126

@alexsohn1126 alexsohn1126 commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Sets up the pieces that let Seer start investigations from outside Sentry, starting with Slack. This PR only adds the shape; every method is a no-op and nothing calls them yet. The real logic and the Slack click handler come in #126751.

  • New SeerInvestigationEntrypoint protocol and investigation_entrypoint_registry, following the existing autofix and agent entrypoints.
  • New SeerInvestigationOperator with has_access and trigger_investigation. has_access returns False for now.
  • New SlackInvestigationEntrypoint, registered for Slack, and its SlackInvestigationCachePayload.

Refs CW-2134 CW-2136

@alexsohn1126
alexsohn1126 added this pull request to stack #126901 October 8, 2026 16:56
@linear-code

linear-code Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

CW-2134

CW-2136

@sentry

sentry Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
0 0 0 0 620 0 ✅ Unchanged

⚙️ sentry-frontend Snapshot Settings

@alexsohn1126
alexsohn1126 marked this pull request as ready for review October 8, 2026 20:14
@alexsohn1126
alexsohn1126 requested a review from a team as a code owner October 8, 2026 20:14
slack_user_id: NotRequired[str]


class SlackInvestigationCachePayload(TypedDict):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it a limitation of the entrypoint + operator pattern that these payloads are stored in redis with the 24 hour expiry or is the storage medium configurable?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Storage medium is def configurable, but thought I'd follow the existing pattern until this project ends, I think there is a benefit to be had by moving these to a table perhaps, needs more thinking though

Comment on lines +87 to +95
organization_id: int
integration_id: int
channel_id: str
thread_ts: str
alert_message_ts: str
status_message_ts: str | None
slack_user_id: str
last_sent_state: str | None
final_sent: bool

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we add comments here describing the ambiguous fields? not sure what alert_message, statuse_message, last_sent_state, final_sent are? are these properties of Slack or Investigations?

@alexsohn1126
alexsohn1126 force-pushed the alexsohn/cw-2134-investigation-entrypoint-scaffold branch from 844957d to 4c19333 Compare October 13, 2026 18:57
Base automatically changed from alexsohn/cw-2134-implement-slack-integration-for-investigations to master October 14, 2026 14:18
@alexsohn1126
alexsohn1126 requested review from a team as code owners October 14, 2026 14:18
@alexsohn1126
alexsohn1126 force-pushed the alexsohn/cw-2134-investigation-entrypoint-scaffold branch from 4c19333 to 2aaade0 Compare October 14, 2026 14:18
Add the SeerInvestigationEntrypoint protocol, an investigation entrypoint
registry, SeerInvestigationOperator and a registered
SlackInvestigationEntrypoint. All methods are no-ops for now, and
nothing calls them yet. The real logic and the Slack click handler come
in a follow-up.

Refs CW-2134
@alexsohn1126
alexsohn1126 force-pushed the alexsohn/cw-2134-investigation-entrypoint-scaffold branch from 2aaade0 to 5637639 Compare October 14, 2026 15:51
@alexsohn1126
alexsohn1126 merged commit d66ba45 into master Oct 14, 2026
70 checks passed
@alexsohn1126
alexsohn1126 deleted the alexsohn/cw-2134-investigation-entrypoint-scaffold branch October 14, 2026 16:51
alexsohn1126 added a commit that referenced this pull request Oct 16, 2026
)

Clicking the "Investigate with Seer" button on a Slack metric alert now
starts a Seer investigation for that alert -- when the org has both the
investigations flag and the Slack investigations flag turned on. #126723
added the button, and this fills in the empty pieces from #126900.

When someone clicks, we first check that they've linked their Slack
account to Sentry and that they're a member of the org. If they haven't
linked, they get the usual prompt to link. If they aren't a member, the
flags are off, or the org doesn't allow open membership (same rule as
the investigations page), they get a message only they can see saying
why. The alert and open period from the button are looked up within the
org, so a click can't reach another org's alert. If an investigation
already exists for that open period, they just get a link to it.

When a new investigation starts, the button on the alert turns into an
"Open investigation" link, and we post "`@someone` started a Seer
investigation for this alert." in the alert's thread. That thread
message, and the private message someone gets if Seer can't start the
investigation, are built with notification platform templates like our
other Seer messages. We still post them ourselves, since the platform
can't post in a thread. We keep the channel and thread in the cache for
24 hours so later updates know where to post.

The started message is a one-time announcement and never gets edited.
Live status comes in a follow-up, as a separate message in the thread
that's posted once the investigation makes its first real progress.

Refs CW-2134
Completes CW-2136
RudraPatel2003 pushed a commit that referenced this pull request Oct 19, 2026
)

Clicking the "Investigate with Seer" button on a Slack metric alert now
starts a Seer investigation for that alert -- when the org has both the
investigations flag and the Slack investigations flag turned on. #126723
added the button, and this fills in the empty pieces from #126900.

When someone clicks, we first check that they've linked their Slack
account to Sentry and that they're a member of the org. If they haven't
linked, they get the usual prompt to link. If they aren't a member, the
flags are off, or the org doesn't allow open membership (same rule as
the investigations page), they get a message only they can see saying
why. The alert and open period from the button are looked up within the
org, so a click can't reach another org's alert. If an investigation
already exists for that open period, they just get a link to it.

When a new investigation starts, the button on the alert turns into an
"Open investigation" link, and we post "`@someone` started a Seer
investigation for this alert." in the alert's thread. That thread
message, and the private message someone gets if Seer can't start the
investigation, are built with notification platform templates like our
other Seer messages. We still post them ourselves, since the platform
can't post in a thread. We keep the channel and thread in the cache for
24 hours so later updates know where to post.

The started message is a one-time announcement and never gets edited.
Live status comes in a follow-up, as a separate message in the thread
that's posted once the investigation makes its first real progress.

Refs CW-2134
Completes CW-2136
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