8000 Fix broken sampler after backpressure change by sl0thentr0py · Pull Request #3702 · getsentry/sentry-python · GitHub
[go: up one dir, main page]

Skip to content

Fix broken sampler after backpressure change #3702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 28, 2024
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):
B621
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
0