Skip to content

Commit

Permalink
feat(sdk-crashes): Set SDK version as release (#52501)
Browse files Browse the repository at this point in the history
Set SDK version as release to understand on which SDK versions the SDK
crashes occur.
  • Loading branch information
philipphofmann authored Jul 10, 2023
1 parent 85a4fdb commit 2af7207
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/sentry/utils/sdk_crashes/sdk_crash_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ def detect_sdk_crash(
},
)

sdk_version = get_path(sdk_crash_event_data, "sdk", "version")
set_path(sdk_crash_event_data, "release", value=sdk_version)

# So Sentry can tell how many projects are impacted by this SDK crash
set_path(sdk_crash_event_data, "user", "id", value=event.project.id)

Expand Down
2 changes: 2 additions & 0 deletions tests/sentry/utils/sdk_crashes/test_sdk_crash_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def execute_test(self, event_data, should_be_reported, mock_sdk_crash_reporter):
assert reported_event_data["user"] == {
"id": event.project_id,
}

assert reported_event_data["release"] == get_path(event_data, "sdk", "version")
else:
assert mock_sdk_crash_reporter.report.call_count == 0

Expand Down

0 comments on commit 2af7207

Please sign in to comment.