Skip to content

Conversation

@snigdhas
Copy link
Contributor

@snigdhas snigdhas commented Apr 18, 2025

We're renaming MetricAlertFire to MetricIssue (PR). To do so, we need to drop existing detectors that use the metric_alert_fire slug. There's ~230 rows that match that filter and the table has ~3k rows. All the rows in the table were written during a test of the dual write and are safe to drop as they'll be rewritten again once the flag is on. I've marked this as post-deploy but it probably doesn't need to be.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 18, 2025
@github-actions
Copy link
Contributor

This PR has a migration; here is the generated SQL for src/sentry/workflow_engine/migrations/0046_drop_metric_alert_fire_detectors.py ()

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

@codecov
Copy link

codecov bot commented Apr 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #89924       +/-   ##
===========================================
+ Coverage   74.82%   87.74%   +12.91%     
===========================================
  Files       10201    10216       +15     
  Lines      575312   576344     +1032     
  Branches    22655    22655               
===========================================
+ Hits       430500   505713    +75213     
+ Misses     144378    70197    -74181     
  Partials      434      434               

@snigdhas snigdhas marked this pull request as ready for review April 18, 2025 16:56
@snigdhas snigdhas requested review from a team as code owners April 18, 2025 16:56
@mifu67
Copy link
Contributor

mifu67 commented Apr 18, 2025

If we're dropping the detectors, we probably also want to drop the dual written metric alert workflows.

Copy link
Contributor

@saponifi3d saponifi3d left a comment

Choose a reason for hiding this comment

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

lgtm - cc @mifu67 to make sure the rollout flag is at 0 (and that we'll want to keep it at 0 until we can update to metric_issue)

also +1 to michelle's callout abuot dropping the workflows -- probably easier to do before we drop the detectors to use the DetectorWorkflow lookups.

Copy link
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.

lgtm, is there any way that more of these will get created in between running this and merging your other pr?

@mifu67
Copy link
Contributor

mifu67 commented Apr 18, 2025

@wedamija dual write is currently turned off (rollout set to 0%), so there shouldn't be any new detectors created with the old slug.

@snigdhas snigdhas merged commit 0222007 into master Apr 21, 2025
64 checks passed
@snigdhas snigdhas deleted the snigdha/drop-metric-alert-fire branch April 21, 2025 23:40
@sentry
Copy link

sentry bot commented Apr 22, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ ProgrammingError: UndefinedTable('relation "workflow_engine_workflow" does not exist\nLINE 1: ..., "workflow_engine_workflow"."owner_user_id" FROM "workflow_...\n ^\n') sentry.workflow_engine.migrations.0046_drop_met... View Issue

Did you find this useful? React with a 👍 or 👎

andrewshie-sentry pushed a commit that referenced this pull request Apr 22, 2025
We're renaming `MetricAlertFire` to `MetricIssue`
([PR](#89896)). To do so, we
need to drop existing detectors that use the `metric_alert_fire` slug.
There's ~230 rows that match that filter and the table has ~3k rows. All
the rows in the table were written during a test of the dual write and
are safe to drop as they'll be rewritten again once the flag is on. I've
marked this as post-deploy but it probably doesn't need to be.
snigdhas added a commit that referenced this pull request Apr 22, 2025
We're renaming `MetricAlertFire` to `MetricIssue` and changing the group
type slug from `metric_alert_fire` to `metric_issue`. This change is
safe to land once [this
migration](#89924) drops all the
existing detector rows that use `metric_alert_fire`.

I've left a skeleton class def with the slug to keep getsentry tests
passing. The [corresponding getsentry
PR](https://github.com/getsentry/getsentry/pull/17255) can land after
this one, and then I'll remove the class in a followup.
@github-actions github-actions bot locked and limited conversation to collaborators May 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants