Skip to content

Commit 34eca95

Browse files
committed
Defer PR 14 and document self-instrumentation modules in the checker
Keep the existing package layout for the four self-instrumentation modules (opentelemetry-api-1.0, opentelemetry-extension-annotations-1.0, opentelemetry-instrumentation-annotations-1.16, opentelemetry-instrumentation-api) instead of renaming them under .opentelemetry.* as PR 14 / open-telemetry#18747 proposed. Promote them in the checker from a generic historical wildcard to a dedicated self-instrumentation case block with a comment explaining why the standard module-name <-> package-name convention does not apply. The javaagent:opentelemetry-instrumentation-api unversioned-module allowlist entry was removed at the same time because the new case block already short-circuits before the unversioned check.
1 parent c2bf70e commit 34eca95

2 files changed

Lines changed: 32 additions & 23 deletions

File tree

.github/scripts/check-package-names.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,24 @@ check_source_set() {
7070
instrumentation/vertx/vertx-sql-client/vertx-sql-client-common-4.0/javaagent/src/main/java/io/vertx/sqlclient/impl*) continue ;;
7171
esac
7272

73+
# self-instrumentation modules: these instrument OpenTelemetry's own code,
74+
# so the standard module-name <-> package-name convention (which treats the
75+
# first dash-separated token as the instrumented library's namespace) does
76+
# not apply; package layout is owned by these modules and reviewed by hand
77+
case "$dir" in
78+
instrumentation/opentelemetry-api/opentelemetry-api-1.0/javaagent/*) continue ;;
79+
instrumentation/opentelemetry-extension-annotations-1.0/javaagent/*) continue ;;
80+
instrumentation/opentelemetry-instrumentation-annotations-1.16/javaagent/*) continue ;;
81+
instrumentation/opentelemetry-instrumentation-api/javaagent/*) continue ;;
82+
esac
83+
7384
# historical javaagent modules that do not follow the module-name <-> package-name convention
7485
case "$dir" in
7586
instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11) continue ;;
7687
instrumentation/aws-sdk/aws-sdk-2.2/javaagent/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/internal) continue ;;
7788
instrumentation/java-http-client/javaagent/*) continue ;;
7889
instrumentation/java-http-server/javaagent/*) continue ;;
7990
instrumentation/java-util-logging/javaagent/*) continue ;;
80-
instrumentation/opentelemetry-api/opentelemetry-api-1.0/javaagent/*) continue ;;
81-
instrumentation/opentelemetry-extension-annotations-1.0/javaagent/*) continue ;;
82-
instrumentation/opentelemetry-instrumentation-annotations-1.16/javaagent/*) continue ;;
83-
instrumentation/opentelemetry-instrumentation-api/javaagent/*) continue ;;
8491
esac
8592
fi
8693

@@ -115,7 +122,6 @@ check_source_set() {
115122
javaagent:jsf-common-jakarta) ;;
116123
javaagent:jsf-common-javax) ;;
117124
javaagent:methods) ;;
118-
javaagent:opentelemetry-instrumentation-api) ;;
119125
javaagent:rmi) ;;
120126
javaagent:runtime-telemetry) ;;
121127
javaagent:servlet-common) ;;

package-name-exceptions-plan.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Updated on 2026-05-26 after PRs 27a, 27b, and the Spring testing-package alignme
1818
Updated again on 2026-05-26 after auditing remaining unversioned-allowlist entries against the documented base-version convention and planning PRs 29-30.
1919
Updated on 2026-05-28 after PRs 29 and 30 merged upstream together as #18854 and their `library:oshi`, `javaagent:oshi`, and `javaagent:elasticsearch-transport-common` allowlist entries were removed from the checker.
2020
Updated on 2026-06-02 after PR 17 merged upstream as #18772 (Akka/Scala forkjoin module renames), and after #18855 moved the `servlet-common` library internal package; both allowlist entries were removed from the checker.
21+
Updated again on 2026-06-02 after deciding to keep the four self-instrumentation modules' historical packages and document them as self-instrumentation in the checker instead of renaming them (PR 14 / #18747 deferred).
2122

2223
## Goal
2324

@@ -146,7 +147,7 @@ For common-module package moves, search for downstream versioned modules importi
146147

147148
## Open Cleanup PRs
148149

149-
PR 14 is open as #18747. PR 22 (#18784) was closed without merging. Keep `.github/scripts/check-package-names.sh` and checker exception removals on `next` until cleanup PRs merge.
150+
PR 14 (#18747) and PR 22 (#18784) were closed without merging. Keep `.github/scripts/check-package-names.sh` and checker exception removals on `next` until cleanup PRs merge.
150151

151152
For JDK instrumentation modules, keep the leading `java` token in package paths. For example,
152153
`java-util-logging` maps to `io.opentelemetry.javaagent.instrumentation.java.util.logging`, while
@@ -161,34 +162,36 @@ example, `payara-embedded-web:5.2020.2` maps to `payara-5.2020` and package suff
161162
would create noisy module names unless they identify a real boundary such as a muzzle range or
162163
sibling module split.
163164

164-
### PR 14: OpenTelemetry annotation and instrumentation API modules (open #18747)
165+
### PR 14: OpenTelemetry annotation and instrumentation API modules (deferred, #18747 to be closed)
165166

166167
Modules:
167168

169+
- `opentelemetry-api-1.0`
168170
- `opentelemetry-extension-annotations-1.0`
169171
- `opentelemetry-instrumentation-api`
170172
- `opentelemetry-instrumentation-annotations-1.16`
171173

172-
Expected package changes:
173-
174-
- `io.opentelemetry.javaagent.instrumentation.extensionannotations.v1_0` -> `io.opentelemetry.javaagent.instrumentation.opentelemetry.extension.annotations.v1_0`
175-
- `io.opentelemetry.javaagent.instrumentation.instrumentationapi` -> `io.opentelemetry.javaagent.instrumentation.opentelemetry.instrumentation.api`
176-
- `io.opentelemetry.javaagent.instrumentation.instrumentationannotations.v1_16` -> `io.opentelemetry.javaagent.instrumentation.opentelemetry.instrumentation.annotations.v1_16`
174+
Decision: do not rename these packages. The original proposal moved them under
175+
`io.opentelemetry.javaagent.instrumentation.opentelemetry.*`, which adds an
176+
`opentelemetry.opentelemetry` redundancy (and `instrumentation.instrumentation` for the API/annotations
177+
modules) for no real navigation gain. These four are self-instrumentation modules: the agent
178+
instruments OpenTelemetry's own code, so the convention that treats the first dash-separated module
179+
token as the instrumented library's namespace does not meaningfully apply.
177180

178-
Notes:
181+
Keep the existing packages and promote them in the checker from a generic "historical" wildcard to a
182+
dedicated `self-instrumentation modules` case block with a comment that explains why the standard
183+
convention is skipped. Current packages stay as:
179184

180-
- Around 30 changed Java files after the dependent Kotlin coroutines import is included.
181-
- Reference audit found only local package declarations/imports for `opentelemetry-extension-annotations-1.0`.
182-
- `opentelemetry-instrumentation-api` has local tests in `src/test` and `src/testOldServerSpan` that must move with the main package.
183-
- Update dependent import(s) in `kotlinx-coroutines-1.0` for instrumentation annotations.
184-
- `opentelemetry-instrumentation-api` still remains in the unversioned-module allowlist unless the module name changes; the PR removes only the broad historical package skip after merge.
185+
- `opentelemetry-api-1.0` -> `io.opentelemetry.javaagent.instrumentation.opentelemetryapi[.*]`
186+
- `opentelemetry-extension-annotations-1.0` -> `io.opentelemetry.javaagent.instrumentation.extensionannotations.v1_0`
187+
- `opentelemetry-instrumentation-annotations-1.16` -> `io.opentelemetry.javaagent.instrumentation.instrumentationannotations.v1_16`
188+
- `opentelemetry-instrumentation-api` -> `io.opentelemetry.javaagent.instrumentation.instrumentationapi`
185189

186-
Suggested verification:
190+
The `javaagent:opentelemetry-instrumentation-api` unversioned-module allowlist entry was removed at
191+
the same time because the self-instrumentation case block already short-circuits before the
192+
unversioned check.
187193

188-
```bash
189-
.github/scripts/check-package-names.sh
190-
./gradlew :instrumentation:opentelemetry-extension-annotations-1.0:javaagent:test :instrumentation:opentelemetry-instrumentation-api:javaagent:test :instrumentation:opentelemetry-instrumentation-annotations-1.16:javaagent:test :instrumentation:kotlinx-coroutines:kotlinx-coroutines-1.0:javaagent:compileJava
191-
```
194+
Close #18747 once this lands on `next`.
192195

193196
### PR 17: Akka and Scala forkjoin module/package names (merged #18772)
194197

0 commit comments

Comments
 (0)