Skip to content
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

Move scope context init outside integration #3850

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

sl0thentr0py
Copy link
Member

The scope context management init cannot be inside the integration since that would not work when we use default_integrations=False and other such cases.

Copy link

codecov bot commented Dec 4, 2024

❌ 306 Tests Failed:

Tests completed Failed Passed Skipped
19258 306 18952 4438
View the full list of 3 ❄️ flaky tests
tests.test_scope test_get_current_scope_tags

Flake rate in main: 30.34% (Passed 62 times, Failed 27 times)

Stack Traces | 0.001s run time
tests/test_scope.py:341: in test_get_current_scope_tags
    assert scope1.client.__class__ == NonRecordingClient
E   AttributeError: client
tests.test_scope test_get_current_scope_tags

Flake rate in main: 40.00% (Passed 24 times, Failed 16 times)

Stack Traces | 0.001s run time
tests/test_scope.py:341: in test_get_current_scope_tags
    assert scope1.client.__class__ == NonRecordingClient
E   AttributeError: 'PotelScope' object has no attribute 'client'
tests.test_scope test_get_current_scope_tags

Flake rate in main: 32.08% (Passed 36 times, Failed 17 times)

Stack Traces | 0.001s run time
tests/test_scope.py:341: in test_get_current_scope_tags
    assert scope1.client.__class__ == NonRecordingClient
E   AttributeError: 'PotelScope' object has no attribute 'client'

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

Copy link
Contributor

@sentrivana sentrivana left a comment

Choose a reason for hiding this comment

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

👍🏻

`use_scope`

Since the otel context span reference is the source of truth for the
current active span, we need to explicitly pass the span reference on
the scope through when we use `use_scope` since we are changing context
variables in the other thread.

Also,

* fixes some typing in the original scope
* adds more types to the `contextvars_context` manager
@sl0thentr0py sl0thentr0py merged commit 65fbd50 into potel-base Dec 5, 2024
62 of 113 checks passed
@sl0thentr0py sl0thentr0py deleted the neel/potel/move-scope-init branch December 5, 2024 13:22
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.

2 participants