Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/sentry/interfaces/contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,15 @@ class OtelContextType(ContextType):
context_to_tag_mapping = {}


@contexttype
class UnityContextType(ContextType):
type = "unity"
context_to_tag_mapping = {
"is_main_thread": "{is_main_thread}",
"install_mode": "{install_mode}",
}


class Contexts(Interface):
"""
This interface stores context specific information.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
source: tests/sentry/event_manager/interfaces/test_contexts.py
---
errors: null
tags:
- - unity.install_mode
- Store
- - unity.is_main_thread
- 'yes'
to_json:
unity:
active_scene_name: MainScene
editor_version: 2022.3.1f1
install_mode: Store
is_main_thread: true
rendering_threading_mode: MultiThreaded
target_frame_rate: '60'
type: unity
15 changes: 15 additions & 0 deletions tests/sentry/event_manager/interfaces/test_contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,18 @@ def test_large_nested_numbers() -> None:
"type": "default",
}
assert ctx_data == expected_data


def test_unity(make_ctx_snapshot) -> None:
make_ctx_snapshot(
{
"unity": {
"active_scene_name": "MainScene",
"editor_version": "2022.3.1f1",
"install_mode": "Store",
"is_main_thread": True,
"rendering_threading_mode": "MultiThreaded",
"target_frame_rate": "60",
}
}
)
Loading