-
Notifications
You must be signed in to change notification settings - Fork 514
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
(0) Cleaning up existing code to prepare for new Scopes API #2611
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Moved some functionality from Hub to Scope or Client: - moved `add_breadcrumb` from Hub to Scope - moved session functions from Hub to Scope - moved `get_integration1` from Hub to Client. This is preparation work for refactoring how we deal with Hubs and Scopes in the future. Each commit is moving one function, so it should be easy to review commit by commit.
…)` (#2570) Improves the capabilities of our threadlocal context variables, we use when no "real" context variables are available (for example in old Python versions) - Adds a no-op [copy_context](https://docs.python.org/3/library/contextvars.html#contextvars.copy_context) function to use in environments without context vars - Adds [reset](https://docs.python.org/3/library/contextvars.html#contextvars.ContextVar.reset) functionality to our threadlocal based context vars. This is preparation work for refactoring how we deal with Hubs and Scopes in the future.
Moved some functionality from Hub to Client: - Capture Event: - moved `capture_event` from Hub to Client - created new `capture_event` in Scope that calls `capture_event` in Client - made `capture_event` in Hub call the new `capture_event` in Scope - Capture Exception: - created new `capture_exception` in Scope - made `capture_exception` in Hub call the new one in Scope - Capture Message: - created new `capture_message` in Scope - made `capture_message` in Hub call the new one in Scope - renamed `**scope_args` to `**scope_kwargs` because it contains keyword arguments. - moved `_update_scope` from Hub to Scope and renamed it to `_merge_scopes` This is preparation work for refactoring how we deal with Hubs and Scopes in the future. Its properly easier to reason about this change when checking out the branch than looking at the diff.
Moved some functionality from Hub to Client: - sorted some typing imports - moved `get_traceparent` from Hub to Scope - moved `get_baggage` from Hub to Scope - moved `iter_trace_propagation_headers` from Hub to Scope - moved `trace_propagation_meta` from Hub to Scope This is preparation work for refactoring how we deal with Hubs and Scopes in the future.
antonpirker
changed the title
(0) New Scopes API
(0) Cleaning up existing code to prepare for new Scopes API
Jan 22, 2024
Closed
sl0thentr0py
approved these changes
Jan 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This cleans up existing code and reorganizes it to have a clean foundation for the refactoring the Hub and Scopes. This does not change any behavior and can be released in a minor version.