Skip to content

Commit a967dbd

Browse files
authored
Merge branch 'main' into use-has-value-satisfying
2 parents c3942f9 + 7cfee29 commit a967dbd

1,743 files changed

Lines changed: 10968 additions & 7514 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,3 +761,7 @@ ij_properties_spaces_around_key_value_delimiter = false
761761
[{*.yaml, *.yml}]
762762
ij_yaml_keep_indents_on_empty_lines = false
763763
ij_yaml_keep_line_breaks = true
764+
765+
[*.md]
766+
# Markdown line length is handled by rumdl
767+
max_line_length = off

.fossa.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ targets:
420420
target: ':instrumentation:cassandra:cassandra-4.4:library'
421421
- type: gradle
422422
path: ./
423-
target: ':instrumentation:clickhouse:clickhouse-client-common:javaagent'
423+
target: ':instrumentation:clickhouse:clickhouse-client-common-0.5:javaagent'
424424
- type: gradle
425425
path: ./
426426
target: ':instrumentation:clickhouse:clickhouse-client-v1-0.5:javaagent'
@@ -513,7 +513,7 @@ targets:
513513
target: ':instrumentation:hibernate:hibernate-6.0:javaagent'
514514
- type: gradle
515515
path: ./
516-
target: ':instrumentation:hibernate:hibernate-common:javaagent'
516+
target: ':instrumentation:hibernate:hibernate-common-3.3:javaagent'
517517
- type: gradle
518518
path: ./
519519
target: ':instrumentation:hibernate:hibernate-procedure-call-4.3:javaagent'
@@ -564,16 +564,16 @@ targets:
564564
target: ':instrumentation:jaxws:jaxws-2.0-axis2-1.6:javaagent'
565565
- type: gradle
566566
path: ./
567-
target: ':instrumentation:jaxws:jaxws-common:javaagent'
567+
target: ':instrumentation:jaxws:jaxws-2.0-cxf-3.0:javaagent'
568568
- type: gradle
569569
path: ./
570-
target: ':instrumentation:jaxws:jaxws-cxf-3.0:javaagent'
570+
target: ':instrumentation:jaxws:jaxws-2.0-metro-2.2:javaagent'
571571
- type: gradle
572572
path: ./
573-
target: ':instrumentation:jaxws:jaxws-jws-api-1.1:javaagent'
573+
target: ':instrumentation:jaxws:jaxws-common:javaagent'
574574
- type: gradle
575575
path: ./
576-
target: ':instrumentation:jaxws:jaxws-metro-2.2:javaagent'
576+
target: ':instrumentation:jaxws:jaxws-jws-api-1.1:javaagent'
577577
- type: gradle
578578
path: ./
579579
target: ':instrumentation:jboss-logmanager:jboss-logmanager-appender-1.1:javaagent'
@@ -591,7 +591,7 @@ targets:
591591
target: ':instrumentation:jedis:jedis-4.0:javaagent'
592592
- type: gradle
593593
path: ./
594-
target: ':instrumentation:jedis:jedis-common:javaagent'
594+
target: ':instrumentation:jedis:jedis-common-1.4:javaagent'
595595
- type: gradle
596596
path: ./
597597
target: ':instrumentation:jetty:jetty-11.0:javaagent'
@@ -624,10 +624,10 @@ targets:
624624
target: ':instrumentation:jms:jms-3.0:javaagent'
625625
- type: gradle
626626
path: ./
627-
target: ':instrumentation:jms:jms-common:bootstrap'
627+
target: ':instrumentation:jms:jms-common-1.1:bootstrap'
628628
- type: gradle
629629
path: ./
630-
target: ':instrumentation:jms:jms-common:javaagent'
630+
target: ':instrumentation:jms:jms-common-1.1:javaagent'
631631
- type: gradle
632632
path: ./
633633
target: ':instrumentation:jsf:jsf-common-jakarta:javaagent'
@@ -882,7 +882,7 @@ targets:
882882
target: ':instrumentation:redisson:redisson-3.17:javaagent'
883883
- type: gradle
884884
path: ./
885-
target: ':instrumentation:redisson:redisson-common:javaagent'
885+
target: ':instrumentation:redisson:redisson-common-3.0:javaagent'
886886
- type: gradle
887887
path: ./
888888
target: ':instrumentation:restlet:restlet-1.1:javaagent'
@@ -1131,7 +1131,7 @@ targets:
11311131
target: ':instrumentation:play:play-ws:play-ws-2.1:javaagent'
11321132
- type: gradle
11331133
path: ./
1134-
target: ':instrumentation:play:play-ws:play-ws-common:javaagent'
1134+
target: ':instrumentation:play:play-ws:play-ws-common-1.0:javaagent'
11351135
- type: gradle
11361136
path: ./
11371137
target: ':instrumentation:reactor:reactor-netty:reactor-netty-0.9:javaagent'
@@ -1194,7 +1194,7 @@ targets:
11941194
target: ':instrumentation:vertx:vertx-http-client:vertx-http-client-5.0:javaagent'
11951195
- type: gradle
11961196
path: ./
1197-
target: ':instrumentation:vertx:vertx-http-client:vertx-http-client-common:javaagent'
1197+
target: ':instrumentation:vertx:vertx-http-client:vertx-http-client-common-3.0:javaagent'
11981198
- type: gradle
11991199
path: ./
12001200
target: ':instrumentation:vertx:vertx-sql-client:vertx-sql-client-4.0:javaagent'
@@ -1203,7 +1203,7 @@ targets:
12031203
target: ':instrumentation:vertx:vertx-sql-client:vertx-sql-client-5.0:javaagent'
12041204
- type: gradle
12051205
path: ./
1206-
target: ':instrumentation:vertx:vertx-sql-client:vertx-sql-client-common:javaagent'
1206+
target: ':instrumentation:vertx:vertx-sql-client:vertx-sql-client-common-4.0:javaagent'
12071207

12081208
experimental:
12091209
gradle:

.github/agents/code-review-and-fix.agent.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -178,27 +178,27 @@ Auto-fix boundaries:
178178
but absent from the current module's check (or vice versa) reveal a version boundary —
179179
the class was likely added or removed between versions.
180180
Then determine the comment form for each class:
181-
**Positive floor class** (proves "at least version X"): look up when the class was
182-
**introduced** → comment `// added in X.Y`.
183-
**Positive ceiling class** (proves "not yet version Y"): look up when the class was
184-
**removed** → comment `// removed in Y.Z` (meaning: its presence here ensures we
185-
don't match version Y.Z+ where a different module takes over).
186-
**Negated exclusion class** in `not(hasClassesNamed(...))`: look up when the class was
187-
**introduced** → comment `// added in Y.Z`, because that first appearance begins the
188-
excluded version range.
189-
**Single positive class that provides both bounds**: include both facts in one comment,
190-
e.g. `// added in X.Y, removed in Y.Z`.
191-
A ceiling class might have been *introduced* much earlier than the module's target version.
192-
Do not use `// added in` for a positive ceiling class — that is misleading. The relevant
193-
fact is when it was **removed**. But for a negated exclusion class, `// added in` is the
194-
correct form because the class's introduction is exactly what starts excluding newer versions.
195-
Validate the version in the comment before adding or requesting it. Do not guess the
196-
version from the module name alone; confirm it with repository or upstream evidence.
197-
Sources: muzzle `versions.set(...)` ranges, sibling module `classLoaderMatcher()` checks,
198-
module directory names, existing code comments, Javadoc/release notes.
199-
Do NOT add a `classLoaderMatcher()` override where one does not already exist —
200-
this method is only for version-boundary detection when muzzle is insufficient,
201-
not for optimization (use `TypeInstrumentation.classLoaderOptimization()` instead)
181+
**Positive floor class** (proves "at least version X"): look up when the class was
182+
**introduced** → comment `// added in X.Y`.
183+
**Positive ceiling class** (proves "not yet version Y"): look up when the class was
184+
**removed** → comment `// removed in Y.Z` (meaning: its presence here ensures we
185+
don't match version Y.Z+ where a different module takes over).
186+
**Negated exclusion class** in `not(hasClassesNamed(...))`: look up when the class was
187+
**introduced** → comment `// added in Y.Z`, because that first appearance begins the
188+
excluded version range.
189+
**Single positive class that provides both bounds**: include both facts in one comment,
190+
e.g. `// added in X.Y, removed in Y.Z`.
191+
A ceiling class might have been *introduced* much earlier than the module's target version.
192+
Do not use `// added in` for a positive ceiling class — that is misleading. The relevant
193+
fact is when it was **removed**. But for a negated exclusion class, `// added in` is the
194+
correct form because the class's introduction is exactly what starts excluding newer versions.
195+
Validate the version in the comment before adding or requesting it. Do not guess the
196+
version from the module name alone; confirm it with repository or upstream evidence.
197+
Sources: muzzle `versions.set(...)` ranges, sibling module `classLoaderMatcher()` checks,
198+
module directory names, existing code comments, Javadoc/release notes.
199+
Do NOT add a `classLoaderMatcher()` override where one does not already exist —
200+
this method is only for version-boundary detection when muzzle is insufficient,
201+
not for optimization (use `TypeInstrumentation.classLoaderOptimization()` instead)
202202
- redundant `isMethod()` in method matchers inside `transform()` when the matcher already
203203
names a specific, non-empty method (e.g., `isMethod().and(named("execute"))`
204204
`named("execute")`). Do not remove `isMethod()` when the name could be empty —

.github/agents/knowledge/api-deprecation-policy.md

Lines changed: 125 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,23 @@
22

33
## Quick Reference
44

5-
- Use when: reviewing public API removals/renames, `@Deprecated` usage, stable-vs-alpha compatibility
6-
- Review focus: deprecate-then-remove timing, delegation direction, required Javadoc/CHANGELOG coverage
5+
- Use when: reviewing public API removals/renames, `@Deprecated` usage, stable-vs-alpha compatibility, or any module rename that touches user-facing config keys or emitted telemetry identity
6+
- Review focus: deprecate-then-remove timing, delegation direction, required Javadoc/CHANGELOG coverage, v3-preview gating for config keys and scope names
7+
8+
## What Counts as "Public API"
9+
10+
"API" here means **anything a user's code or configuration depends on by name**, including:
11+
12+
- Java symbols in published artifacts (classes, methods, fields in `:library`, `:testing`,
13+
`instrumentation-api*`).
14+
- User-facing configuration keys — `otel.instrumentation.<name>.enabled`, any
15+
`otel.instrumentation.*` property, and the equivalent declarative YAML keys.
16+
- Outgoing telemetry identity — anything users can match on in their backend, including
17+
`otel.scope.name`, span names, metric names, attribute keys, and attribute values. Users
18+
build dashboards, filters, and alerts on these values, so silently renaming them is a
19+
breaking change.
20+
21+
A rename of any of these surfaces is a breaking change even if no Java symbol moved.
722

823
## When Are Breaking Changes Allowed?
924

@@ -75,6 +90,107 @@ default void configure(IgnoredTypesBuilder builder, ConfigProperties config) {
7590
}
7691
```
7792

93+
## Module renames: config keys and emitted scope names
94+
95+
A module rename touches **two user-facing API surfaces** that must each be preserved by default
96+
and only change under `otel.instrumentation.common.v3-preview`. The mechanism differs because
97+
the surfaces are different: config keys can coexist as aliases, emitted scope names cannot.
98+
99+
### 1. `InstrumentationModule` names (controls `otel.instrumentation.<name>.enabled`)
100+
101+
The names passed to the `InstrumentationModule` constructor drive the
102+
`otel.instrumentation.<name>.enabled` config keys — any of them, not just the first. A rename
103+
silently breaks users who have the old key in their config.
104+
105+
Keep the pre-rename name by passing it inline alongside the current name using the
106+
{@code "<current>|deprecated:<old>"} marker recognized by the `InstrumentationModule`
107+
constructor:
108+
109+
```java
110+
public CxfInstrumentationModule() {
111+
super("cxf", "jaxws-2.0-cxf-3.0|deprecated:jaxws-cxf-3.0", "jaxws");
112+
}
113+
```
114+
115+
The framework (`DeprecatedInstrumentationNames.expand`) splits the marker and registers both
116+
names, so both `otel.instrumentation.jaxws-2.0-cxf-3.0.enabled` and
117+
`otel.instrumentation.jaxws-cxf-3.0.enabled` keep working (flat properties and YAML alike).
118+
Under `otel.instrumentation.common.v3-preview=true` the deprecated name is dropped; if the
119+
legacy key is explicitly set, a one-time WARNING is logged pointing at the new key.
120+
121+
No per-module `AgentCommonConfig` branching, `isV3Preview()` checks, or bespoke logging are
122+
needed — one string literal is the entire change.
123+
124+
### 2. Emitted instrumentation scope name (`INSTRUMENTATION_NAME` in `*Singletons`)
125+
126+
The `INSTRUMENTATION_NAME` string passed to `Instrumenter.builder(...)` becomes the
127+
`otel.scope.name` attribute on every emitted span / metric / log. A rename silently breaks
128+
dashboards and filters that match on the old scope.
129+
130+
Keep emitting the **pre-rename** scope name by default, and switch to the new one only under
131+
v3-preview:
132+
133+
```java
134+
public class CxfSingletons {
135+
private static final String INSTRUMENTATION_NAME =
136+
AgentCommonConfig.get().isV3Preview()
137+
? "io.opentelemetry.jaxws-2.0-cxf-3.0"
138+
// keep the pre-rename scope name so existing dashboards/filters on
139+
// otel.scope.name="io.opentelemetry.jaxws-cxf-3.0" continue to work
140+
: "io.opentelemetry.jaxws-cxf-3.0";
141+
...
142+
}
143+
```
144+
145+
Note the asymmetry with the config-key case: there the list carries **both** names at once
146+
(aliases); here only **one** scope name is emitted at a time, and the default is the **old**
147+
one. Do not log a deprecation warning here — users cannot switch the scope name without
148+
enabling v3-preview globally (which affects every module), so a warning would push them
149+
toward something they are not expected to enable generally.
150+
151+
Emitting the old scope name by default has one consequence: the version `.properties` file
152+
generated by `generateInstrumentationVersionFile` is named after the **new** module name
153+
(e.g. `io.opentelemetry.jaxws-2.0-cxf-3.0.properties`), and `Instrumenter.builder` looks the
154+
version up via `EmbeddedInstrumentationProperties.findVersion(instrumentationName)` keyed on
155+
the scope name passed in. With the old name as the default the lookup returns `null`, the
156+
emitted scope has no version, and `TelemetryDataUtil.assertScopeVersion` fails every test in
157+
CI with:
158+
159+
> Instrumentation version of module `io.opentelemetry.<old>` was empty; make sure that the
160+
> instrumentation name matches the gradle module name
161+
162+
Resolve this by looking up the version under the **new** module name and calling
163+
`setInstrumentationVersion` on the builder explicitly:
164+
165+
```java
166+
private static final String VERSION_LOOKUP_NAME = "io.opentelemetry.jaxws-2.0-cxf-3.0";
167+
168+
private static final String INSTRUMENTATION_NAME =
169+
AgentCommonConfig.get().isV3Preview() ? VERSION_LOOKUP_NAME : "io.opentelemetry.jaxws-cxf-3.0";
170+
171+
static {
172+
InstrumenterBuilder<CxfRequest, Void> builder =
173+
Instrumenter.<CxfRequest, Void>builder(
174+
GlobalOpenTelemetry.get(), INSTRUMENTATION_NAME, CxfRequest::spanName)
175+
.setEnabled(...);
176+
String version = EmbeddedInstrumentationProperties.findVersion(VERSION_LOOKUP_NAME);
177+
if (version != null) {
178+
builder.setInstrumentationVersion(version);
179+
}
180+
instrumenter = builder.buildInstrumenter();
181+
}
182+
```
183+
184+
### CHANGELOG
185+
186+
The rename is **not** a breaking change or a deprecation in the current release: by default
187+
the old config keys and scope names continue to work unchanged, and the new names are only
188+
visible under `otel.instrumentation.common.v3-preview` — a preview flag that users are not
189+
generally encouraged to enable. Do not add a `⚠️ Breaking changes to non-stable APIs` or
190+
`🚫 Deprecations` entry for this kind of rename. If mentioned at all, it belongs in whatever
191+
section tracks v3-preview changes. The breaking change will be recorded when v3-preview
192+
becomes the default in 3.0.
193+
78194
## What to Flag in Review
79195

80196
- **Breaking change without a prior deprecation**: a method/class was removed or its signature
@@ -98,3 +214,10 @@ default void configure(IgnoredTypesBuilder builder, ConfigProperties config) {
98214

99215
- **Missing CHANGELOG entry**: a breaking change PR that does not add an
100216
`⚠️ Breaking changes to non-stable APIs` bullet in the `Unreleased` section of `CHANGELOG.md`.
217+
218+
- **Module rename without backcompat**: `InstrumentationModule` constructor uses only the new
219+
name, dropping the pre-rename name that drove the legacy
220+
`otel.instrumentation.<old>.enabled` config key (it should be appended to the new name with
221+
the {@code "|deprecated:<old>"} marker so `DeprecatedInstrumentationNames` can gate it on
222+
v3-preview); and/or `*Singletons#INSTRUMENTATION_NAME` was changed unconditionally instead
223+
of being gated on `AgentCommonConfig.get().isV3Preview()`.

0 commit comments

Comments
 (0)