-
Notifications
You must be signed in to change notification settings - Fork 344
Rework shim between ContextManager and the legacy scope manager #11938
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,8 +13,10 @@ | |
| import datadog.trace.agent.tooling.bytebuddy.matcher.ClassLoaderMatchers; | ||
| import datadog.trace.api.Config; | ||
| import datadog.trace.api.IdGenerationStrategy; | ||
| import datadog.trace.api.InstrumenterConfig; | ||
| import datadog.trace.bootstrap.InstrumentationErrors; | ||
| import datadog.trace.bootstrap.instrumentation.api.AgentSpan; | ||
| import datadog.trace.bootstrap.instrumentation.api.AgentTracer; | ||
| import datadog.trace.bootstrap.instrumentation.api.AgentTracer.TracerAPI; | ||
| import datadog.trace.common.writer.ListWriter; | ||
| import datadog.trace.core.CoreTracer; | ||
|
|
@@ -75,6 +77,10 @@ static void initAll() { | |
| // injected into the bootstrap classpath. | ||
| assertNull(Config.class.getClassLoader(), "Config must load on the bootstrap classpath."); | ||
|
|
||
| if (InstrumenterConfig.get().isLegacyContextManagerEnabled()) { | ||
| AgentTracer.installLegacyContextManager(); | ||
| } | ||
|
|
||
|
Comment on lines
+80
to
+83
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❔ question: Is this supposed to stay? I would rather not query Config/InstrumentationConfig at this level. I might need to think about how to use some JUnit extension mechanism.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typically, I would recommend creating a dedicated temporary extension, based on the one like
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How else can we test the feature-flag?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note this needs to be after any config mutation - for forked JUnit tests are we setting config overrides outside the process or in an extension? |
||
| // Create shared test writer and tracer | ||
| writer = new ListWriter(); | ||
| CoreTracer coreTracer = | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.