-
Notifications
You must be signed in to change notification settings - Fork 566
Closed
Description
How do you use Sentry?
Sentry Saas (sentry.io)
Version
2.42.0
Steps to Reproduce
We use a before_send
hook that cleans up some breadcrumbs with sensitive data.
It basically does:
def strip_sentry_sensitive_data(event, _hint)
for breadcrumb_value in event.get("breadcrumbs", {}).get("values", []):
# cleanup some breadcrumbs
Expected Result
The event is properly sent.
Actual Result
It works fine for errors & spans but we stopped receiving some (but not all) cron monitor final check_in.
Launching the command with SENTRY_DEBUG=1
gave us:
[sentry] ERROR: Internal error in sentry_sdk
Traceback (most recent call last):
File "/project/.venv/lib/python3.13/site-packages/sentry_sdk/client.py", line 630, in _prepare_event
new_event = before_send(event, hint or {})
File "/project/config/sentry.py", line 31, in strip_sentry_sensitive_data
for breadcrumb_value in event.get("breadcrumbs", {}).get("values", []):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'get'
Internal error in sentry_sdk
Traceback (most recent call last):
File "/project/.venv/lib/python3.13/site-packages/sentry_sdk/client.py", line 630, in _prepare_event
new_event = before_send(event, hint or {})
File "/project/les-emplois/config/sentry.py", line 31, in strip_sentry_sensitive_data
for breadcrumb_value in event.get("breadcrumbs", {}).get("values", []):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'get'
[sentry] INFO: before send dropped event
before send dropped event
And debugging the failing event ·breadcrumbs
is indeed a list with seems unexpected.
Here the produced event:
{'type': 'check_in', 'monitor_slug': 'my_monitor_slug', 'check_in_id': 'f679641c053c448cb5b40cb5ba0d2d6a', 'status': 'ok', 'duration': 1.425353399999949, 'environment': 'production', 'release': '7ce42f6fcfca6e22fc6c6db7c247f94dcc7e9cf5', 'monitor_config': {'schedule': {'type': 'crontab', 'value': '*/30 7-18 * * MON-FRI'}, 'checkin_margin': 5, 'max_runtime': 10, 'failure_issue_threshold': 2, 'recovery_threshold': 1, 'timezone': 'UTC'}, 'event_id': '539c3fb7cfb84ee094b74ea9be176099', 'timestamp': '2025-10-17T08:12:06.120779Z', 'contexts': {'trace': {'trace_id': '5aaa32dbd2ea4912a6c4baa339c34c8a', 'span_id': 'a065c8a7a12f4ba0', 'parent_span_id': None, 'dynamic_sampling_context': {'trace_id': '5aaa32dbd2ea4912a6c4baa339c34c8a', 'environment': 'production', 'release': '7ce42f6fcfca6e22fc6c6db7c247f94dcc7e9cf5', 'public_key': '2a078ca82ea34322b4ed1a9c1f2b934d', 'sample_rate': '1.0'}}}, 'server_name': 'xafer-G15', 'sdk': {'name': 'sentry.python.django', 'version': '2.42.0', 'packages': [{'name': 'pypi:sentry-sdk', 'version': '2.42.0'}], 'integrations': ['argv', 'atexit', 'boto3', 'dedupe', 'django', 'excepthook', 'httpx', 'huey', 'logging', 'modules', 'redis', 'stdlib', 'threading']}, 'platform': 'python', 'breadcrumbs': [], '_meta': {'breadcrumbs': {'': {'len': 114}}}}
Metadata
Metadata
Assignees
Projects
Status
Waiting for: Product Owner