Skip to content

feat(spans-migration): self hosted spans migration for discover saved queries#106018

Open
nikkikapadia wants to merge 9 commits intomasterfrom
nikki/discover-self-hosted-migration
Open

feat(spans-migration): self hosted spans migration for discover saved queries#106018
nikkikapadia wants to merge 9 commits intomasterfrom
nikki/discover-self-hosted-migration

Conversation

@nikkikapadia
Copy link
Copy Markdown
Member

@nikkikapadia nikkikapadia commented Jan 9, 2026

We've migrated all discover queries on all regions (including single tenant) and are looking to migrate self hosted queries as well. This migration utilizes the migration function that we made and applies it to all the queries here.

NOTE: i won't be merging this until some feature flags are put into the next self-hosted release. Don't worry if it's sitting unmerged for a while :)

Closes EXP-552

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 9, 2026
@getsantry
Copy link
Copy Markdown
Contributor

getsantry bot commented Jan 31, 2026

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added the Stale label Jan 31, 2026
@getsantry
Copy link
Copy Markdown
Contributor

getsantry bot commented Jan 31, 2026

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@nikkikapadia nikkikapadia removed the Stale label Feb 2, 2026
@getsantry getsantry bot added the Stale label Feb 24, 2026
@getsantry
Copy link
Copy Markdown
Contributor

getsantry bot commented Feb 24, 2026

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry
Copy link
Copy Markdown
Contributor

getsantry bot commented Mar 18, 2026

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added the Stale label Mar 18, 2026
Comment thread src/sentry/migrations/1064_discover_to_explore_queries_self_hosted.py Outdated
@github-actions
Copy link
Copy Markdown
Contributor

This PR has a migration; here is the generated SQL for src/sentry/migrations/1056_discover_to_explore_queries_self_hosted.py

for 1056_discover_to_explore_queries_self_hosted in sentry

--
-- Raw Python operation
--
-- THIS OPERATION CANNOT BE WRITTEN AS SQL

@nikkikapadia nikkikapadia changed the title chore(spans-migration): self hosted spans migration for discover saved queries feat(spans-migration): self hosted spans migration for discover saved queries Mar 24, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Typo in migration hints table name breaks routing
    • Fixed typo by changing 'explpre_exploresavedquery' to 'explore_exploresavedquery' to match the actual db_table name in the ExploreSavedQuery model.

Create PR

Or push these changes by commenting:

@cursor push 0a731ce614
Preview (0a731ce614)
diff --git a/src/sentry/migrations/1064_discover_to_explore_queries_self_hosted.py b/src/sentry/migrations/1064_discover_to_explore_queries_self_hosted.py
--- a/src/sentry/migrations/1064_discover_to_explore_queries_self_hosted.py
+++ b/src/sentry/migrations/1064_discover_to_explore_queries_self_hosted.py
@@ -92,7 +92,7 @@ class Migration(CheckedMigration):
                     "sentry_discoversavedquery",
                     "sentry_discoversavedqueryproject",
                     "explore_exploresavedqueryproject",
-                    "explpre_exploresavedquery",
+                    "explore_exploresavedquery",
                 ]
             },
         )

@@ -92,7 +92,7 @@ class Migration(CheckedMigration):
                     "sentry_discoversavedquery",
                     "sentry_discoversavedqueryproject",
                     "explore_exploresavedqueryproject",
-                    "explpre_exploresavedquery",
+                    "explore_exploresavedquery",
                 ]
             },
         )

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3929c59. Configure here.

Comment thread src/sentry/migrations/1064_discover_to_explore_queries_self_hosted.py Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

This PR has a migration; here is the generated SQL for src/sentry/migrations/1064_discover_to_explore_queries_self_hosted.py

for 1064_discover_to_explore_queries_self_hosted in sentry

--
-- Raw Python operation
--
-- THIS OPERATION CANNOT BE WRITTEN AS SQL

@nikkikapadia nikkikapadia marked this pull request as ready for review April 7, 2026 17:59
@nikkikapadia nikkikapadia requested review from a team as code owners April 7, 2026 17:59
@linear-code
Copy link
Copy Markdown

linear-code bot commented Apr 7, 2026

Copy link
Copy Markdown
Member

@wedamija wedamija left a comment

Choose a reason for hiding this comment

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

Similar feedback to #104803

tl;dr is that you should copy/paste translate_discover_query_to_explore_query into this migration and not import the external models (use DiscoverSavedQuery = apps.get_model("sentry", "DiscoverSavedQuery"))

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