Add opt-in instrumentation support for generated lambda classes - #12346
Add opt-in instrumentation support for generated lambda classes#12346amarziali wants to merge 28 commits into
Conversation
|
@DataDog review |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
On JDK 8 and JDK 11, the new structure matcher requires a field that does not exist. The lambda transformer does not run, and Runnable lambdas still use wrappers.
🤖 Datadog Autotest · Commit 054841c · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
054841c to
5742c20
Compare
|
@DataDog review |
There was a problem hiding this comment.
More details
The PR instruments generated Runnable lambdas so executor propagation keeps task identity, with supported JDK paths and a Graal build guard. This update fixes the earlier JDK 8 and 11 samBase mismatch and adds no new finding; the documented concurrent-reuse limitation remains, and no review finding is open.
🤖 Datadog Autotest · Commit 5655a6f · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
|
@DataDog review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a721063dff
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
A hidden Runnable lambda can put its type description in the shared name cache. A later real class with the same legal binary name can receive wrong instrumentation on JDK 21 and later.
🤖 Datadog Autotest · Commit a721063 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
|
@DataDog review |
There was a problem hiding this comment.
The new module has no Gradle lock file. Its dependency graph can change between builds.
🤖 Datadog Autotest · Commit b11c8c6 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
b64ffbe to
490090a
Compare
There was a problem hiding this comment.
More details
The opt-in lambda path limits transformation to registered functional interfaces and keeps generated-class metadata out of shared caches.
🤖 Datadog Autotest · Commit 490090a · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
What Does This Do?
Adds opt-in infrastructure for applying Datadog instrumentations to classes generated by
LambdaMetafactory.Generated lambda classes are normally defined without passing through the standard Java agent transformation path. This change instruments
InnerClassLambdaMetafactoryat the byte-generation point and routeseligible lambda bytecode through the existing transformer before class definition.
The infrastructure is disabled by default and can be enabled with:
Enabling it alone does not select any production lambda classes. An enabled instrumentation must explicitly implement Instrumenter.ForLambda and register the exact functional interface it supports.
Notable Changes
Compatibility and Limitations
Lambda transformation is intentionally best-effort:
Motivation
Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]