Skip to content

feat(span buffer): Add span-first slow DB span detector#117551

Open
lobsterkatie wants to merge 9 commits into
masterfrom
kmclb-add-span-first-slow-db-span-detector
Open

feat(span buffer): Add span-first slow DB span detector#117551
lobsterkatie wants to merge 9 commits into
masterfrom
kmclb-add-span-first-slow-db-span-detector

Conversation

@lobsterkatie

@lobsterkatie lobsterkatie commented Jun 12, 2026

Copy link
Copy Markdown
Member

As a first step to converting all of our performance detectors to work with the span buffer, this adds a span-first version of the slow DB span detector, along with span-first versions of some of our testing utils. Note that nothing yet runs this detector - that will come in a follow-up PR. (Update: That PR is here.)

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 12, 2026
Comment thread src/sentry/testutils/issue_detection/segment_span_generators.py
@lobsterkatie lobsterkatie force-pushed the kmclb-add-span-first-slow-db-span-detector branch 5 times, most recently from 1790b1a to 98ee840 Compare June 15, 2026 12:11
@getsentry getsentry deleted a comment from github-actions Bot Jun 15, 2026
@lobsterkatie lobsterkatie marked this pull request as ready for review June 15, 2026 14:38
@lobsterkatie lobsterkatie requested review from a team as code owners June 15, 2026 14:38
Comment thread src/sentry/issue_detection/detectors/span_first/slow_db_query_detector.py Outdated
@lobsterkatie lobsterkatie force-pushed the kmclb-add-span-first-slow-db-span-detector branch from 98ee840 to 9dfb9af Compare June 15, 2026 17:25
from sentry.issues.grouptype import GroupType


class SpanFirstDetector(ABC):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is there a spec or something that explains why we are creating a new class for span first detectors vs updating the existing ones to also support span first?

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.

Mostly because Matt and I agreed that adding a bunch of conditionals into the existing detectors would end up being a lot messier and more work to clean up compared to making new versions which are span-native. It also mirrors what happened for all of the rest of the code called by _process_segment. It duplicates the parts of save_transaction_events which still apply, rather than trying to add conditionals into whatever helpers save_transaction_events calls.

Comment thread src/sentry/issue_detection/detectors/span_first/span_first_utils.py
@lobsterkatie lobsterkatie force-pushed the kmclb-add-span-first-slow-db-span-detector branch from 9dfb9af to 976c985 Compare June 15, 2026 18:09
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