Skip to content
Merged
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
7 changes: 4 additions & 3 deletions sentry_sdk/integrations/opentelemetry/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@ def dropped_result(parent_span_context, attributes, sample_rate=None):
else:
reason = "sample_rate"

client.transport.record_lost_event(reason, data_category="transaction")
if client.transport and has_tracing_enabled(client.options):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we explicitly check against None?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we do this everywhere it's fine

client.transport.record_lost_event(reason, data_category="transaction")

# Only one span (the transaction itself) is discarded, since we did not record any spans here.
client.transport.record_lost_event(reason, data_category="span")
# Only one span (the transaction itself) is discarded, since we did not record any spans here.
client.transport.record_lost_event(reason, data_category="span")

return SamplingResult(
Decision.DROP,
Expand Down
Loading