Skip to content

Commit 04a68a6

Browse files
committed
add monitor name and hint to error message
1 parent ff1be0a commit 04a68a6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

sentry_sdk/integrations/celery.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,8 @@ def _get_humanized_interval(seconds):
395395
return (int(seconds), "second")
396396

397397

398-
def _get_monitor_config(celery_schedule, app):
399-
# type: (Any, Celery) -> Dict[str, Any]
398+
def _get_monitor_config(celery_schedule, app, monitor_name):
399+
# type: (Any, Celery, str) -> Dict[str, Any]
400400
monitor_config = {} # type: Dict[str, Any]
401401
schedule_type = None # type: Optional[str]
402402
schedule_value = None # type: Optional[Union[str, int]]
@@ -419,7 +419,9 @@ def _get_monitor_config(celery_schedule, app):
419419

420420
if schedule_unit == "second":
421421
logger.warning(
422-
"Intervals shorter than one minute are not supported by Sentry Crons."
422+
"Intervals shorter than one minute are not supported by Sentry Crons. Monitor '%s' has an interval of %s seconds. Use the `exclude_beat_tasks` option in the celery integration to exclude it.",
423+
monitor_name,
424+
schedule_value,
423425
)
424426
return {}
425427

@@ -466,7 +468,7 @@ def sentry_apply_entry(*args, **kwargs):
466468
# When tasks are started from Celery Beat, make sure each task has its own trace.
467469
scope.set_new_propagation_context()
468470

469-
monitor_config = _get_monitor_config(celery_schedule, app)
471+
monitor_config = _get_monitor_config(celery_schedule, app, monitor_name)
470472

471473
is_supported_schedule = bool(monitor_config)
472474
if is_supported_schedule:

0 commit comments

Comments
 (0)