|
| 1 | +DEBUG:posthog:consumer is running... |
| 2 | +DEBUG:posthog:queueing: {'properties': {'$exception_type': 'ZeroDivisionError', '$exception_message': 'division by zero', '$exception_list': [{'mechanism': {'type': 'generic', 'handled': True}, 'module': None, 'type': 'ZeroDivisionError', 'value': 'division by zero', 'stacktrace': {'frames': [{'platform': 'python', 'filename': 'test.py', 'abs_path': '/Users/ablaszkiewicz/Documents/repos/posthog-python/test.py', 'function': '<module>', 'module': '__main__', 'lineno': 57, 'pre_context': [' my_lambda = lambda x: x * 2', ' my_function = trigger_error', ' ', ' 1/0', ''], 'context_line': 'trigger_error()', 'post_context': [], 'in_app': True, 'code_variables': {'CircularRef': "<class '__main__.CircularRef'>", 'CustomObject': "<class '__main__.CustomObject'>", 'CustomReprClass': "<class '__main__.CustomReprClass'>", 'Decimal': "<class 'decimal.Decimal'>", 'Fraction': "<class 'fractions.Fraction'>", 'Posthog': "<class 'posthog.Posthog'>", 'datetime': "<class 'datetime.datetime'>", 'os': "<module 'os' (frozen)>", 'posthog': '<posthog.Posthog object at 0x105b4a350>', 're': "<module 're' from '/Users/ablaszkiewicz/.local/share/uv/python/cpython-3.11.12-macos-aarch64-none/lib/python3.11/re/__init__.py'>", 'timedelta': "<class 'datetime.timedelta'>", 'trigger_error': '<function trigger_error at 0x1077a0720>'}}, {'platform': 'python', 'filename': 'test.py', 'abs_path': '/Users/ablaszkiewicz/Documents/repos/posthog-python/test.py', 'function': 'trigger_error', 'module': '__main__', 'lineno': 55, 'pre_context': [' my_obj = CustomObject(42)', ' my_circular = CircularRef()', ' my_lambda = lambda x: x * 2', ' my_function = trigger_error', ' '], 'context_line': ' 1/0', 'post_context': ['', 'trigger_error()'], 'in_app': True, 'code_variables': {'my_bytearray': "bytearray(b'mutable bytes')", 'my_bytes': "b'hello bytes'", 'my_circular': '<CircularRef with self-reference>', 'my_complex': '(3+4j)', 'my_custom': '<CustomReprClass: custom representation>', 'my_datetime': 'datetime.datetime(2024, 1, 15, 10, 30, 45)', 'my_decimal': "Decimal('123.456')", 'my_fraction': 'Fraction(3, 4)', 'my_frozenset': 'frozenset({4, 5, 6})', 'my_function': '<function trigger_error at 0x1077a0720>', 'my_lambda': '<function trigger_error.<locals>.<lambda> at 0x1077a07c0>', 'my_memoryview': '<memory at 0x1076d2500>', 'my_obj': 'CustomObject(value=42)', 'my_range': 'range(0, 10)', 'my_regex': "re.compile('\\\\d+')", 'my_set': '{1, 2, 3}', 'my_timedelta': 'datetime.timedelta(days=5, seconds=10800)'}}], 'type': 'raw'}}], '$python_runtime': 'CPython', '$python_version': '3.11.12', '$os': 'Mac OS X', '$os_version': '15.6.1', '$process_person_profile': False, '$lib': 'posthog-python', '$lib_version': '6.9.1', '$geoip_disable': True}, 'timestamp': '2025-11-15T09:17:48.228041+00:00', 'distinct_id': '0d6d2c5b-7dde-4066-a691-b005b13e8220', 'event': '$exception', 'uuid': 'd96626d6-a5b7-4d50-8e2a-0b957826aea5'} |
| 3 | +DEBUG:posthog:enqueued $exception. |
| 4 | +Traceback (most recent call last): |
| 5 | + File "/Users/ablaszkiewicz/Documents/repos/posthog-python/test.py", line 57, in <module> |
| 6 | + trigger_error() |
| 7 | + File "/Users/ablaszkiewicz/Documents/repos/posthog-python/test.py", line 55, in trigger_error |
| 8 | + 1/0 |
| 9 | + ~^~ |
| 10 | +ZeroDivisionError: division by zero |
| 11 | +DEBUG:posthog:making request: {"batch": [{"properties": {"$exception_type": "ZeroDivisionError", "$exception_message": "division by zero", "$exception_list": [{"mechanism": {"type": "generic", "handled": true}, "module": null, "type": "ZeroDivisionError", "value": "division by zero", "stacktrace": {"frames": [{"platform": "python", "filename": "test.py", "abs_path": "/Users/ablaszkiewicz/Documents/repos/posthog-python/test.py", "function": "<module>", "module": "__main__", "lineno": 57, "pre_context": [" my_lambda = lambda x: x * 2", " my_function = trigger_error", " ", " 1/0", ""], "context_line": "trigger_error()", "post_context": [], "in_app": true, "code_variables": {"CircularRef": "<class '__main__.CircularRef'>", "CustomObject": "<class '__main__.CustomObject'>", "CustomReprClass": "<class '__main__.CustomReprClass'>", "Decimal": "<class 'decimal.Decimal'>", "Fraction": "<class 'fractions.Fraction'>", "Posthog": "<class 'posthog.Posthog'>", "datetime": "<class 'datetime.datetime'>", "os": "<module 'os' (frozen)>", "posthog": "<posthog.Posthog object at 0x105b4a350>", "re": "<module 're' from '/Users/ablaszkiewicz/.local/share/uv/python/cpython-3.11.12-macos-aarch64-none/lib/python3.11/re/__init__.py'>", "timedelta": "<class 'datetime.timedelta'>", "trigger_error": "<function trigger_error at 0x1077a0720>"}}, {"platform": "python", "filename": "test.py", "abs_path": "/Users/ablaszkiewicz/Documents/repos/posthog-python/test.py", "function": "trigger_error", "module": "__main__", "lineno": 55, "pre_context": [" my_obj = CustomObject(42)", " my_circular = CircularRef()", " my_lambda = lambda x: x * 2", " my_function = trigger_error", " "], "context_line": " 1/0", "post_context": ["", "trigger_error()"], "in_app": true, "code_variables": {"my_bytearray": "bytearray(b'mutable bytes')", "my_bytes": "b'hello bytes'", "my_circular": "<CircularRef with self-reference>", "my_complex": "(3+4j)", "my_custom": "<CustomReprClass: custom representation>", "my_datetime": "datetime.datetime(2024, 1, 15, 10, 30, 45)", "my_decimal": "Decimal('123.456')", "my_fraction": "Fraction(3, 4)", "my_frozenset": "frozenset({4, 5, 6})", "my_function": "<function trigger_error at 0x1077a0720>", "my_lambda": "<function trigger_error.<locals>.<lambda> at 0x1077a07c0>", "my_memoryview": "<memory at 0x1076d2500>", "my_obj": "CustomObject(value=42)", "my_range": "range(0, 10)", "my_regex": "re.compile('\\\\d+')", "my_set": "{1, 2, 3}", "my_timedelta": "datetime.timedelta(days=5, seconds=10800)"}}], "type": "raw"}}], "$python_runtime": "CPython", "$python_version": "3.11.12", "$os": "Mac OS X", "$os_version": "15.6.1", "$process_person_profile": false, "$lib": "posthog-python", "$lib_version": "6.9.1", "$geoip_disable": true}, "timestamp": "2025-11-15T09:17:48.228041+00:00", "distinct_id": "0d6d2c5b-7dde-4066-a691-b005b13e8220", "event": "$exception", "uuid": "d96626d6-a5b7-4d50-8e2a-0b957826aea5"}], "historical_migration": false, "sentAt": "2025-11-15T09:17:48.730239+00:00", "api_key": "phc_J1o2BXYxzXBHJeG2mS5hk62ijkTWk38Z385lO0MhU5w"} to url: http://localhost:8010/batch/ |
| 12 | +DEBUG:posthog:data uploaded successfully |
| 13 | +DEBUG:posthog:data uploaded successfully |
| 14 | +DEBUG:posthog:consumer exited. |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | +CAPTURING EXCEPTION |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | +Context enabled state: None |
| 23 | +Self capture_exception_code_variables: True |
| 24 | +Computed enabled state: True |
| 25 | +Trying to attach code variables to frames |
| 26 | +tb_frames found |
| 27 | +exception found |
| 28 | +variables found |
| 29 | +variables: {'CircularRef': "<class '__main__.CircularRef'>", 'CustomObject': "<class '__main__.CustomObject'>", 'CustomReprClass': "<class '__main__.CustomReprClass'>", 'Decimal': "<class 'decimal.Decimal'>", 'Fraction': "<class 'fractions.Fraction'>", 'Posthog': "<class 'posthog.Posthog'>", 'datetime': "<class 'datetime.datetime'>", 'os': "<module 'os' (frozen)>", 'posthog': '<posthog.Posthog object at 0x105b4a350>', 're': "<module 're' from '/Users/ablaszkiewicz/.local/share/uv/python/cpython-3.11.12-macos-aarch64-none/lib/python3.11/re/__init__.py'>", 'timedelta': "<class 'datetime.timedelta'>", 'trigger_error': '<function trigger_error at 0x1077a0720>'} |
| 30 | +code_variables added |
| 31 | +variables found |
| 32 | +variables: {'my_bytearray': "bytearray(b'mutable bytes')", 'my_bytes': "b'hello bytes'", 'my_circular': '<CircularRef with self-reference>', 'my_complex': '(3+4j)', 'my_custom': '<CustomReprClass: custom representation>', 'my_datetime': 'datetime.datetime(2024, 1, 15, 10, 30, 45)', 'my_decimal': "Decimal('123.456')", 'my_fraction': 'Fraction(3, 4)', 'my_frozenset': 'frozenset({4, 5, 6})', 'my_function': '<function trigger_error at 0x1077a0720>', 'my_lambda': '<function trigger_error.<locals>.<lambda> at 0x1077a07c0>', 'my_memoryview': '<memory at 0x1076d2500>', 'my_obj': 'CustomObject(value=42)', 'my_range': 'range(0, 10)', 'my_regex': "re.compile('\\\\d+')", 'my_set': '{1, 2, 3}', 'my_timedelta': 'datetime.timedelta(days=5, seconds=10800)'} |
| 33 | +code_variables added |
0 commit comments