How do you use Sentry?
Sentry Saas (sentry.io)
Version
2.8.0
Steps to Reproduce
I had a task at the company to track Celery beat tasks in Sentry. This task has been completed, and everything is working correctly. However, with each execution of the task, an unusual exception is displayed in Sentry. This happens once every minute.
Since I set the monitor_beat_tasks to True, this event has been occurring.
This exception is handled, but It is not interesting that it is constantly displayed on sentry.
Interestingly, this does not happen in the local environment(in my laptop)! and just we have this problem on production.
My local system:
Ubuntu 22.04
Python 3.10.12
Celery 5.3.6
sentry_sdk 2.8.0
In production we using Docker and Kubernetes, we are using Python:3.10 image and packages versions are same as my local!
Expected Result
Don't show this exception on sentry.
My task is working well and this error has made our sentry busy.
Actual Result


Logs of celery worker in production:
[2024-07-10 20:51:00,088: INFO/MainProcess] Task send_concierge_sale_to_assistant_offer_task[0349add3-713c-4ff0-83b8-fecb44652ea4] received
[2024-07-10 20:51:04,561: ERROR/ForkPoolWorker-4] Signal handler <function crons_task_success at 0x7f83cc319cf0> raised: KeyError('sentry-monitor-start-timestamp-s')
2024-07-10T20:51:04.562478564Z Traceback (most recent call last):
2024-07-10T20:51:04.562484644Z File "/usr/local/lib/python3.10/site-packages/celery/utils/dispatch/signal.py", line 276, in send
2024-07-10T20:51:04.562488411Z response = receiver(signal=self, sender=sender, **named)
2024-07-10T20:51:04.562493177Z File "/usr/local/lib/python3.10/site-packages/sentry_sdk/integrations/celery/beat.py", line 255, in crons_task_success
2024-07-10T20:51:04.562497673Z start_timestamp_s = float(headers["sentry-monitor-start-timestamp-s"])
2024-07-10T20:51:04.562501032Z KeyError: 'sentry-monitor-start-timestamp-s'
[2024-07-10 20:51:04,565: INFO/ForkPoolWorker-4] Task send_concierge_sale_to_assistant_offer_task[0349add3-713c-4ff0-83b8-fecb44652ea4] succeeded in 4.470669243019074s: None
How do you use Sentry?
Sentry Saas (sentry.io)
Version
2.8.0
Steps to Reproduce
I had a task at the company to track Celery beat tasks in Sentry. This task has been completed, and everything is working correctly. However, with each execution of the task, an unusual exception is displayed in Sentry. This happens once every minute.
Since I set the monitor_beat_tasks to True, this event has been occurring.
This exception is handled, but It is not interesting that it is constantly displayed on sentry.
Interestingly, this does not happen in the local environment(in my laptop)! and just we have this problem on production.
My local system:
Ubuntu 22.04
Python 3.10.12
Celery 5.3.6
sentry_sdk 2.8.0
In production we using Docker and Kubernetes, we are using Python:3.10 image and packages versions are same as my local!
Expected Result
Don't show this exception on sentry.
My task is working well and this error has made our sentry busy.
Actual Result
Logs of celery worker in production: