Browse Source

feat(sdk-crash): Keep more exception fields (#68680)

Keep non PII related fields: synthetic and errno with number and name.
Philipp Hofmann 11 months ago
parent
commit
7bad72a75f

+ 5 - 0
fixtures/sdk_crash_detection/crash_event_cocoa.py

@@ -127,6 +127,7 @@ def get_crash_event_with_frames(
                     "mechanism": {
                         "handled": handled,
                         "type": "mach",
+                        "synthetic": False,
                         "meta": {
                             "signal": {
                                 "number": 11,
@@ -140,6 +141,10 @@ def get_crash_event_with_frames(
                                 "subcode": 0,
                                 "name": "EXC_BAD_ACCESS",
                             },
+                            "errno": {
+                                "number": 10,
+                                "name": "EACCES",
+                            },
                         },
                     },
                 }

+ 5 - 0
src/sentry/utils/sdk_crashes/event_stripper.py

@@ -61,6 +61,7 @@ EVENT_DATA_ALLOWLIST = {
             "type": Allow.SIMPLE_TYPE,
             "mechanism": {
                 "handled": Allow.SIMPLE_TYPE,
+                "synthetic": Allow.SIMPLE_TYPE,
                 "type": Allow.SIMPLE_TYPE,
                 "meta": {
                     "signal": {
@@ -75,6 +76,10 @@ EVENT_DATA_ALLOWLIST = {
                         "subcode": Allow.SIMPLE_TYPE,
                         "name": Allow.SIMPLE_TYPE,
                     },
+                    "errno": {
+                        "number": Allow.SIMPLE_TYPE,
+                        "name": Allow.SIMPLE_TYPE,
+                    },
                 },
             },
         }

+ 5 - 0
tests/sentry/utils/sdk_crashes/test_event_stripper.py

@@ -170,6 +170,7 @@ def test_strip_event_data_keeps_exception_mechanism(store_event, configs):
 
     assert mechanism == {
         "handled": False,
+        "synthetic": False,
         "type": "mach",
         "meta": {
             "signal": {"number": 11, "code": 0, "name": "SIGSEGV", "code_name": "SEGV_NOOP"},
@@ -179,6 +180,10 @@ def test_strip_event_data_keeps_exception_mechanism(store_event, configs):
                 "subcode": 0,
                 "name": "EXC_BAD_ACCESS",
             },
+            "errno": {
+                "number": 10,
+                "name": "EACCES",
+            },
         },
     }