Skip to content

More refactoring for ScopeManager#1467

Merged
tylerbenson merged 10 commits into
masterfrom
tyler/scopemanager-split
May 19, 2020
Merged

More refactoring for ScopeManager#1467
tylerbenson merged 10 commits into
masterfrom
tyler/scopemanager-split

Conversation

@tylerbenson
Copy link
Copy Markdown
Contributor

The main goal here is to enable better modularity in how scopes are managed. A ScopeInterceptor can be added to enable wrapping of the scope to support various behaviors. This process also allowed splitting up existing logic to more cohesive parts. It might be easier to follow to view individual commits.

@tylerbenson tylerbenson requested a review from a team as a code owner May 15, 2020 22:06
@tylerbenson tylerbenson requested a review from mar-kolya May 15, 2020 22:08
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this essentially for chaining and not really for 'delegate' in a 'wrap and change behaviour'? It would be nice to have some comments into intent of this design.

@mar-kolya
Copy link
Copy Markdown
Contributor

I did look over 'ScopeEvent` part - looks reasonable, but this code could really benefit from more comments explaining design intent - especially for 'base' classes and interfaces.

@tylerbenson tylerbenson force-pushed the tyler/scopemanager-split branch from 06c565a to 17f8681 Compare May 18, 2020 20:00
@tylerbenson tylerbenson force-pushed the tyler/scopemanager-split branch from 17f8681 to d6c007f Compare May 18, 2020 20:52
Copy link
Copy Markdown
Contributor

@randomanderson randomanderson left a comment

Choose a reason for hiding this comment

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

There's better separation of concerns than before but it's still more complicated than I had hoped. Maybe that's just the nature of Scope in the project. I think there's some residual weirdness around the ContinualScopeManager constructor and the duplication of the ScopeListeners that can be addressed in another PR.

After this lands, I want to attempt to simplify the OT bridge classes and fix log injection for custom scope managers.


then: "last scope is still valid"
(scope as ContinuableScope).depth() == depth
(scope as DDScope).depth() == depth
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Isn't this assuming a continuable scope? depth() isn't on DDScope anymore.


and: "scope stack not effected."
(scopeManager.active() as ContinuableScope).depth() == depth
(scopeManager.active() as DDScope).depth() == depth
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

See previous comment about depth()

@tylerbenson tylerbenson force-pushed the tyler/scopemanager-split branch 2 times, most recently from 6b09fc4 to c4d6698 Compare May 18, 2020 23:31
@tylerbenson tylerbenson force-pushed the tyler/scopemanager-split branch from c4d6698 to cb44882 Compare May 18, 2020 23:51
@tylerbenson tylerbenson merged commit 3ec1170 into master May 19, 2020
@tylerbenson tylerbenson deleted the tyler/scopemanager-split branch May 19, 2020 01:17
@github-actions github-actions Bot added this to the 0.52.0 milestone May 19, 2020
iNikem added a commit to open-telemetry/opentelemetry-java-instrumentation that referenced this pull request May 31, 2020
* Define packages in exporter class loader (#409)

* Update docs about needing java 11 to build (#412)

* Update version to 0.3.0 (#413)

* Update the README (#414)

* Move build and configure to top as getting started section
* Add manual instrumentation section
* Document `@WithSpan` annotation
* Move developer specific information to CONTRIBUTING.md
* Cleanup formatting and use consistent spacing

* Update version to 0.4.0-SNAPSHOT (#415)

* Update CONTRIBUTING.md back to Java 11 (#419)

* Add Zipkin exporter support  (#411)

* #375 Add Zipkin exporter support

Signed-off-by: Sergei Malafeev <sergeymalafeev@gmail.com>

* #375 use OkHttpSender for Zipkin exporter

Signed-off-by: Sergei Malafeev <sergeymalafeev@gmail.com>

* #375 add Zipkin exporter to README

Signed-off-by: Sergei Malafeev <sergeymalafeev@gmail.com>

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>

* Remove inactive maintainer (#420)

* Fix brolen anchor link (#422)

* Fix khttp instrumentation in case of absent or read-only headers map (#416)

* Add new approver (#429)

* Fix sqlNormalizerEnabled initialization (#432)

* Remove unused config (#424)

* Change names of servlet based server spans (#428)

* Add documentation describing non-obvious points of Servlet instrumentations

* Change names of servlet based server spans

* Fix java google format (#439)

* Remove deprecated usage from internal instrumentation (DataDog/dd-trace-java#1441)

* Update gradle to 6.4 (DataDog/dd-trace-java#1443)

* Migrate lettuce instrumentation away from deprecated finishSpanOnClose (DataDog/dd-trace-java#1445)

* Make Retrys consistent (DataDog/dd-trace-java#1442)

* Rename java packages for lettuce 4 and 5 to not have collisions (DataDog/dd-trace-java#1450)

* Adding an option to manually disable Kafka headers (DataDog/dd-trace-java#1448)

* Add version specific names to allow disabling only a specific version (DataDog/dd-trace-java#1456)

* Attempt to improve muzzle time by randomly ignoring versions until 10 remain (DataDog/dd-trace-java#1451)

* Save circle cache with name matching restore patterns (DataDog/dd-trace-java#1457)

* Wrap log statements using varargs to avoid object allocation (DataDog/dd-trace-java#1466)

* Grizzly-http and grizzly-client instrumentation (DataDog/dd-trace-java#1365)

* More refactoring for ScopeManager (DataDog/dd-trace-java#1467)

* Remove Java 9 and 10 from the build (DataDog/dd-trace-java#1473)

* Disable CI cache for muzzle (DataDog/dd-trace-java#1479)

* Separate out core instrumentation for AWS SDK to allow manual setup o… (#421)

* Separate out core instrumentation for AWS SDK to allow manual setup of instrumentation.

* Instrumentation core test

* Fix sporadic Elasticsearch test failures (#444)

* Fix sporadic grizzly test failure (#448)

* Fixes integration with latest version of Finatra (#450)

* #425 allow only one propagator per concern (#451)

* Updates to reflect new repo name (#454)

* Remove printlns that were accidentally committed (#459)

* Remove unnecessary version constant (#455)

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
Co-authored-by: Steve Flanders <steve@omnition.io>
Co-authored-by: Sergei Malafeev <sergeymalafeev@gmail.com>
Co-authored-by: Tyler Benson <tyler.benson@datadoghq.com>
Co-authored-by: Nikolay Martynov <mar.kolya@gmail.com>
Co-authored-by: Brian Devins-Suresh <brian.devinssuresh@datadoghq.com>
Co-authored-by: Richard Startin <richard.startin@datadoghq.com>
Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
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