Skip to content

Commit e908ae0

Browse files
committed
fix(uptime): Always pass span_id from check result to occurrence
1 parent 9169a7d commit e908ae0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/sentry/uptime/issue_platform.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def build_event_data_for_occurrence(
101101
"uptime_rule": str(project_subscription.id),
102102
},
103103
"timestamp": occurrence.detection_time.isoformat(),
104-
"contexts": {"trace": {"trace_id": result["trace_id"], "span_id": None}},
104+
"contexts": {"trace": {"trace_id": result["trace_id"], "span_id": result.get("span_id")}},
105105
}
106106

107107

tests/sentry/uptime/test_issue_platform.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ def test(self):
106106
"sdk": None,
107107
"tags": {"uptime_rule": str(project_subscription.id)},
108108
"timestamp": occurrence.detection_time.isoformat(),
109-
"contexts": {"trace": {"trace_id": result["trace_id"], "span_id": None}},
109+
"contexts": {
110+
"trace": {"trace_id": result["trace_id"], "span_id": result.get("span_id")}
111+
},
110112
}
111113

112114

0 commit comments

Comments
 (0)