8000 Implement new continue_trace and make WSGI work by sl0thentr0py · Pull Request #3460 · getsentry/sentry-python · GitHub
[go: up one dir, main page]

Skip to content

Implement new continue_trace and make WSGI work #3460

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 2 commits into from
Aug 26, 2024

Conversation

sl0thentr0py
Copy link
Member

The new continue_trace API will no longer return a Transaction entity. Instead, it will simply update the propagation context and run as a contextmanager.

(TODO) It will set a remote span on the OTEL context so that it can be picked up by start_span later.

closes #3458


working flask + sqlalchemy trace

image

The new `continue_trace` API will no longer return a `Transaction` entity.
Instead, it will simply update the propagation context and run as a
contextmanager.

(TODO) It will set a remote span on the OTEL context so that it can be picked up by `start_span` later.
Copy link
codecov bot commented Aug 26, 2024

❌ 3992 Tests Failed:

Tests completed Failed Passed Skipped
16490 3992 12498 1916
View the top 3 failed tests by shortest run time
tests.integrations.celery.test_celery test_simple_without_performance[<lambda>1]
Stack Traces | 0s run time
No failure message available
tests.integrations.celery.test_update_celery_task_headers test_span_with_transaction
Stack Traces | 0s run time
No failure message available
tests.integrations.clickhouse_driver.test_clickhouse_driver test_clickhouse_client_spans
Stack Traces | 0s run time
No failure message available

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

Copy link
Member
@szokeasaurusrex szokeasaurusrex left a comment

Choose a reason for hiding this comment

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

Have you considered any way we might be able to avoid making a breaking API change to continue_trace here?

I am thinking it might be possible to avoid this breaking change by somehow setting the environ_or_headers on the transaction, then when the transaction is started, it would be responsible for calling PotelScope.continue_trace when an environ_or_headers is present. Have you considered doing something like this, and if yes, why are we choosing to make a breaking change, instead?

Admittedly, my suggestion might be a bit harder to think through than what you are suggesting in this PR, but it would come with the huge upside of not having a breaking change and therefore not needing to update all our continue_trace calls (plus, less hassle for users when upgrading)

Co-authored-by: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com>
@sl0thentr0py
Copy link
Member Author

yes I have considered and decided. JS also broke this and it's much better semantics this way.

We might reconsider breaking changes together at the end when we are in an acceptable functional state but for now I want to focus on designing ideal semantics in the new world.

@sl0thentr0py sl0thentr0py merged commit 5e35db8 into potel-base Aug 26, 2024
8 of 105 checks passed
@sl0thentr0py sl0thentr0py deleted the neel/potel/continue-trace2 branch August 26, 2024 14:50
@szokeasaurusrex
Copy link
Member

yes I have considered and decided. JS also broke this and it's much better semantics this way.

We might reconsider breaking changes together at the end when we are in an acceptable functional state but for now I want to focus on designing ideal semantics in the new world.

Fair enough, I guess this is fine for now. I agree that if we were designing this from scratch, it would probably make the most sense to do it your way, but I think we should really try to avoid a breaking change here if we can

@szokeasaurusrex
Copy link
Member

Why we are making the breaking API change: #3486 (review)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0