Skip to content

Skip Drools internal types classloader during transformation - #12481

Open
amarziali wants to merge 2 commits into
masterfrom
fix-drools-internal-classloader-skip
Open

amarziali wants to merge 2 commits into
masterfrom
fix-drools-internal-classloader-skip

Conversation

@amarziali

Copy link
Copy Markdown
Contributor

What Does This Do

Adds DynamicProjectClassLoader$DefaultInternalTypesClassLoader to the existing Drools classloader exclusions.

This prevents classes loaded through the Drools executable-model path from entering the instrumentation-matching pipeline and triggering repeated class-resource scans.

The change includes:

  • A focused unit test covering the exact classloader name.
  • A real Drools test that generates a declared fact through this classloader and verifies that it is not transformed.
  • Existing coverage for compiling and executing Drools rules remains intact.

Motivation

Drools 8 and newer use this internal classloader when defining generated types. Because it was not excluded by default, each new classloader could trigger an expensive instrumentation compatibility scan.

Setting the same classloader through DD_TRACE_CLASSLOADERS_EXCLUDE avoids the overhead. This change makes that behavior the default, consistent with the existing Drools classloader exclusions.

Solves #12469

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@amarziali
amarziali requested review from a team as code owners September 14, 2026 07:36
@amarziali
amarziali removed the request for review from a team September 14, 2026 07:36
@amarziali amarziali added the type: feature Enhancements and improvements label Sep 14, 2026
@amarziali
amarziali requested a review from mhdatie September 14, 2026 07:36
@amarziali amarziali added inst: others All other instrumentations tag: override groovy enforcement Override the "Enforce Groovy Migration" check labels Sep 14, 2026
@amarziali
amarziali requested review from ValentinZakharov and removed request for a team September 14, 2026 07:36
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-14T07:40:14.427543Z 0298835 PR opened
🔒 Security Review Completed 2026-09-14T07:41:38.868003Z 0298835 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@datadog-datadog-prod-us1-2 datadog-datadog-prod-us1-2 Bot left a comment

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.

Datadog Autotest: PASS

More details

The new exclusion uses the exact Drools internal class loader name. The changed tests cover direct name matching and generated Drools types.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Datadog Autotest · Commit 0298835 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

@datadog-datadog-prod-us1-2

This comment has been minimized.

@amarziali
amarziali force-pushed the fix-drools-internal-classloader-skip branch from 0298835 to 15fdd4d Compare September 14, 2026 07:57
@dd-octo-sts

dd-octo-sts Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.83 s 14.70 s [+0.0%; +1.9%] (maybe worse)
startup:insecure-bank:tracing:Agent 13.51 s 13.68 s [-1.9%; -0.6%] (maybe better)
startup:petclinic:appsec:Agent 16.94 s 17.35 s [-6.5%; +1.8%] (no difference)
startup:petclinic:iast:Agent 17.41 s 17.49 s [-1.3%; +0.3%] (no difference)
startup:petclinic:profiling:Agent 17.44 s 16.72 s [-0.1%; +8.7%] (no difference)
startup:petclinic:sca:Agent 17.51 s 17.41 s [-0.3%; +1.6%] (no difference)
startup:petclinic:tracing:Agent 16.44 s 16.64 s [-2.3%; -0.1%] (maybe better)

Commit: d86ddf0c · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: others All other instrumentations tag: override groovy enforcement Override the "Enforce Groovy Migration" check type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants