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

Scope refactor #2111

Merged
merged 4 commits into from
Jan 16, 2025
Merged

Scope refactor #2111

merged 4 commits into from
Jan 16, 2025

Conversation

philandstuff
Copy link
Contributor

This is a small refactoring, which takes the _tag_var ContextVar and moves it to be a private attribute of Scope.

Once we've done this, I had hoped that record_metric wouldn't have to live on current_scope() any more (though it could still look up the tag from current_scope() if it wished), but my hopes were dashed because record_metric also needs to find self._events somehow.

This moves _tag_var to Scope, so that we have a single ContextVar rather than
multiple.
@philandstuff
Copy link
Contributor Author

Recording a conversation I had with @erbridge: record_metric should indeed live on current_scope(). But this change is still worthy.

@philandstuff philandstuff merged commit 2f12ead into main Jan 16, 2025
21 checks passed
@philandstuff philandstuff deleted the scope-refactor branch January 16, 2025 13:37
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