-
-
Notifications
You must be signed in to change notification settings - Fork 543
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
make sure _span_holder is reset #3716
make sure _span_holder is reset #3716
Conversation
Reviewer's Guide by SourceryThis PR fixes a bug where the Updated class diagram for OpenTelemetryExtensionclassDiagram
class OpenTelemetryExtension {
- Optional~ArgFilter~ _arg_filter
- Dict~LifecycleStep, Span~ _span_holder
- Tracer _tracer
+ OpenTelemetryExtension(arg_filter: Optional~ArgFilter~, execution_context: Optional~ExecutionContext~)
}
note for OpenTelemetryExtension "_span_holder is now initialized in the constructor to ensure instance-level separation."
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @conglei - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Thanks for adding the Here's a preview of the changelog: Description: Here's the tweet text:
|
Hi, thanks for contributing to Strawberry 🍓! We noticed that this PR is missing a So as soon as this PR is merged, a release will be made 🚀. Here's an example of Release type: patch
Description of the changes, ideally with some examples, if adding a new feature. Release type can be one of patch, minor or major. We use semver, so make sure to pick the appropriate type. If in doubt feel free to ask :) Here's the tweet text:
|
for more information, see https://pre-commit.ci
CodSpeed Performance ReportMerging #3716 will not alter performanceComparing Summary
|
Thanks for contributing to Strawberry! 🎉 You've been invited to join You can also request a free sticker by filling this form: https://forms.gle/dmnfQUPoY5gZbVT67 And don't forget to join our discord server: https://strawberry.rocks/discord 🔥 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3716 +/- ##
==========================================
- Coverage 97.03% 97.00% -0.03%
==========================================
Files 500 501 +1
Lines 33473 33490 +17
Branches 5592 5592
==========================================
+ Hits 32480 32488 +8
- Misses 789 791 +2
- Partials 204 211 +7 |
Description
This PR addresses a bug where the
_span_holder
dictionary in the OpenTelemetryExtension class was shared across all instances due to being defined as a class-level attribute with a mutable default value. The fix is to reset the value of it during init, ensuring that each instance of the class has its own independent dictionary.Types of Changes
Issues Fixed or Closed by This PR
The previous implementation led to unintended consequences:
Checklist
Summary by Sourcery
Reset _span_holder in OpenTelemetryExtension during initialization to prevent shared state across instances and add tests to ensure correct initialization.
Bug Fixes:
Tests: