Skip to content

Commit 5001848

Browse files
committed
add the detector_id from the other stuff to the handler so we can see if it's working
1 parent e1ec768 commit 5001848

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/sentry/workflow_engine/tasks.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,19 @@ def process_workflow_task(activity_id: int) -> None:
3939

4040

4141
@activity_creation_registry.register("workflow_status_update")
42-
def workflow_status_update_handler(activity: Activity) -> None:
42+
def workflow_status_update_handler(activity: Activity, detector_id: int | None) -> None:
4343
"""
4444
Hook the process_workflow_task into the activity creation registry.
4545
4646
Since this handler is called in process for the activity, we want
4747
to queue a task to process workflows asynchronously.
4848
"""
49+
if detector_id is None:
50+
# We should not hit this case, it's should only occur if there is a bug
51+
# passing it from the workflow_engine to the issue platform.
52+
metrics.incr("workflow_engine.error.tasks.no_detector_id")
53+
return
54+
4955
# TODO - implement in follow-up PR for now, just track a metric that we are seeing the activities.
5056
metrics.incr(
5157
"workflow_engine.process_workflow.activity_update", tags={"activity_type": activity.type}

0 commit comments

Comments
 (0)