-
Notifications
You must be signed in to change notification settings - Fork 329
Refactor the dd-java-agent build so otel-shim depends on otel-bootstrap #10810
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
Changes from all commits
8b94e98
2069b2b
8cc4fcf
15cfd87
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 |
|---|---|---|
|
|
@@ -150,6 +150,12 @@ def generalShadowJarConfig(ShadowJar shadowJarTask) { | |
| relocate 'org.snakeyaml.engine', 'datadog.snakeyaml.engine' | ||
| relocate 'okhttp3', 'datadog.okhttp3' | ||
| relocate 'okio', 'datadog.okio' | ||
|
|
||
| // embed an extra copy of our otel-shim for drop-in/extension support | ||
| // extensions are remapped to avoid classpath conflicts; use same mapping here | ||
| relocate 'io.opentelemetry.api', 'datadog.trace.bootstrap.otel.api' | ||
| relocate 'io.opentelemetry.context', 'datadog.trace.bootstrap.otel.context' | ||
| relocate 'datadog.opentelemetry.shim', 'datadog.trace.bootstrap.otel.shim' | ||
|
Comment on lines
+154
to
+158
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: Out of curiosity I wonder if these relocation rules be in
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. No, because we need two copies of the shim:
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. Ahh, I think I get a better picture of how otel support works now. |
||
| } | ||
|
|
||
| if (!project.hasProperty("disableShadowRelocate") || !disableShadowRelocate) { | ||
|
|
@@ -362,6 +368,8 @@ dependencies { | |
| shadowInclude project(path: ':dd-java-agent:agent-bootstrap') | ||
| shadowInclude project(path: ':dd-java-agent:agent-debugger:debugger-bootstrap') | ||
| shadowInclude project(path: ':dd-java-agent:agent-otel:otel-bootstrap', configuration: 'shadow') | ||
| // embed an extra copy of our otel-shim for drop-in/extension support | ||
|
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 it exactly an extra copy ? (I.e I'm mostly wondering if there's a better wording for these comments, there's the same at line 154)
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. It is literally an extra copy - same classes, but shaded to match the embedded+shaded OTel classes needed for drop-in/extension support. The other copy is in the instrumentation section - not shaded because we need it to work with the OTel classes provided from the application class-loader
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. OK makes sense |
||
| shadowInclude project(path: ':dd-java-agent:agent-otel:otel-shim') | ||
| shadowInclude project(path: ':products:feature-flagging:feature-flagging-bootstrap') | ||
|
|
||
| // Includes for the shared internal shadow jar | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
This exclusion is one that was missed during earlier development of the drop-in feature - we deliberately have our own
SqlStatementInfoinotel-bootstrapthat replaces the original. This PR fixes this omission and avoids any temporary duplication, even though the end result is not affected.