Skip to content

Exclude Java source trees from instrumentation discovery - #20956

Merged
trask merged 3 commits into
mainfrom
copilot/trask-fix-module-discovery-bug
Oct 25, 2026
Merged

trask merged 3 commits into
mainfrom
copilot/trask-fix-module-discovery-bug

Conversation

Copilot AI commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

From #20927 (comment)

Prevent Java source-package directories ending in javaagent or library from appearing as fictitious instrumentations in the generated catalog. Reject paths containing an exact src directory segment after separator normalization.

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-10-25 18:29 UTC

Status above doesn't look right?
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix module discovery bug in instrumentation Exclude Java source trees from instrumentation discovery Oct 25, 2026
Copilot AI requested a review from trask October 25, 2026 03:46
@trask
trask requested a balanced review from Copilot October 25, 2026 03:49

Copilot AI 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.

🟢 Approval recommended

The narrowly scoped exclusion addresses false module discovery, with focused regression coverage and no unresolved findings.

No open issues 🎉

What changed in this PR

This PR prevents instrumentation catalog discovery from treating Java source-package directories as modules.

Changes:

  • Reject normalized paths containing an exact src directory segment.
  • Add regression coverage for production and custom test source paths, both separator styles, and discovery of legitimate Spring Integration modules.
File Description
instrumentation-docs/​src/​test/​java/​io/​opentelemetry/​instrumentation/​docs/​utils/​FileManagerTest.java Tests source-directory exclusion and preservation of real modules.
instrumentation-docs/​src/​main/​java/​io/​opentelemetry/​instrumentation/​docs/​utils/​FileManager.java Excludes paths containing /src/ after separator normalization.

Review effort: Balanced

Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI requested a review from trask October 25, 2026 04:20
@trask
trask requested a balanced review from Copilot October 25, 2026 04:25

Copilot AI 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.

🟢 Approval recommended

The narrow filter change matches the stated purpose, includes targeted regression assertions, and has no identified blocking issues.

No open issues 🎉

Review effort: Balanced

@trask
trask marked this pull request as ready for review October 25, 2026 04:36
@trask
trask requested a review from a team as a code owner October 25, 2026 04:36
@trask
trask merged commit 98d90ac into main Oct 25, 2026
71 checks passed
@trask
trask deleted the copilot/trask-fix-module-discovery-bug branch October 25, 2026 18:28
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.

4 participants