Skip to content

Commit 1c8da4f

Browse files
committed
fixes from warden review
1 parent 72d9637 commit 1c8da4f

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

sentry_sdk/integrations/celery/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,11 +389,7 @@ def _wrap_task_call(task: "Any", f: "F") -> "F":
389389
# Need to wrap task call because the exception is caught before we get to
390390
# see it. Also celery's reported stacktrace is untrustworthy.
391391

392-
# functools.wraps is important here because celery-once looks at this
393-
# method's name. @ensure_integration_enabled internally calls functools.wraps,
394-
# but if we ever remove the @ensure_integration_enabled decorator, we need
395-
# to add @functools.wraps(f) here.
396-
# https://github.com/getsentry/sentry-python/issues/421
392+
@wraps(f)
397393
def _inner(*args: "Any", **kwargs: "Any") -> "Any":
398394
client = sentry_sdk.get_client()
399395
if client.get_integration(CeleryIntegration) is None:

sentry_sdk/traces.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,10 @@ def _end(
416416
return
417417

418418
if self.sampled is None:
419-
logger.warning("Discarding transaction without sampling decision.")
419+
logger.warning("Discarding span without sampling decision.")
420+
if client.transport and has_tracing_enabled(client.options):
421+
client.transport.record_lost_event("sample_rate", data_category="span")
422+
return
420423

421424
if self._finished is True:
422425
# This span is already finished, ignore.

tests/tracing/test_span_streaming.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ def test_sibling_segments(sentry_init, capture_envelopes):
497497
assert segment2["is_segment"] is True
498498
assert segment2["parent_span_id"] is None
499499

500-
assert segment1["trace_id"] == segment1["trace_id"]
500+
assert segment1["trace_id"] == segment2["trace_id"]
501501

502502

503503
def test_sibling_segments_new_trace(sentry_init, capture_envelopes):

0 commit comments

Comments
 (0)