Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions sentry_sdk/integrations/celery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@
)
from sentry_sdk.integrations.celery.utils import _now_seconds_since_epoch
from sentry_sdk.integrations.logging import ignore_logger_for_events
from sentry_sdk.scope import Scope, should_send_default_pii
from sentry_sdk.scope import Scope
from sentry_sdk.traces import BAGGAGE_HEADER_NAME, SegmentNameSource, Span
from sentry_sdk.tracing_utils import Baggage
from sentry_sdk.utils import (
SENSITIVE_DATA_SUBSTITUTE,
capture_internal_exceptions,
event_from_exception,
has_data_collection_enabled,
parse_version,
reraise,
)
Expand Down Expand Up @@ -140,16 +138,9 @@ def event_processor(event: "Event", hint: "Hint") -> "Optional[Event]":
celery_job = {"task_name": task.name}

client_options = sentry_sdk.get_client().options
if has_data_collection_enabled(client_options):
if client_options["data_collection"]["queues"]:
celery_job["args"] = args
celery_job["kwargs"] = kwargs
elif should_send_default_pii():
if client_options["data_collection"]["queues"]:
celery_job["args"] = args
celery_job["kwargs"] = kwargs
else:
celery_job["args"] = SENSITIVE_DATA_SUBSTITUTE
celery_job["kwargs"] = SENSITIVE_DATA_SUBSTITUTE

extra["celery-job"] = celery_job

Expand Down
Loading
Loading