Skip to content

Celery logs filtered out #5689

@davidjmemmett

Description

@davidjmemmett

How do you use Sentry?

Self-hosted/on-premise

Version

2.55.0

Steps to Reproduce

  1. Set up a Django app using Celery and sentry-sdk, passing enable_logs=True to sentry_sdk.init()
  2. Trigger a celery task
  3. Observe a log in Sentry for task received (of the format Task {task_name}[{uuid}] received) but not for task succeeded (of the format Task {task_name}[{uuid}] succeeded in {duration}: {data})
  4. Observe a log via traditional Python logging mechanism (or Celery stdout/etc) for both task received and task succeeded

I believe this is caused by the ignore_logger invocation in ./sentry_sdk/integrations/celery/__init__.py:CeleryIntegration.setup_once:

class CeleryIntegration(Integration):
    ...
    @staticmethod
    def setup_once() -> None:
        ...
        ignore_logger("celery.app.trace")

Expected Result

The following logs in Sentry Logs:

Task {task_name}[{uuid}] received
Task {task_name}[{uuid}] succeeded in {duration}: {data}

Actual Result

The following logs in Sentry Logs:

Task {task_name}[{uuid}] received

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

Status

Waiting for: Community

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions