Skip to content

Commit 60dfe35

Browse files
authored
Merge branch 'main' into dubbo-client-lb
2 parents 379318f + afcf274 commit 60dfe35

3,029 files changed

Lines changed: 34886 additions & 31344 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.

.fossa.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,6 @@ targets:
346346
- type: gradle
347347
path: ./
348348
target: ':instrumentation:armeria:armeria-grpc-1.14:javaagent'
349-
- type: gradle
350-
path: ./
351-
target: ':instrumentation:async-http-client:async-http-client-1-common:javaagent'
352349
- type: gradle
353350
path: ./
354351
target: ':instrumentation:async-http-client:async-http-client-1.8:javaagent'
@@ -358,6 +355,9 @@ targets:
358355
- type: gradle
359356
path: ./
360357
target: ':instrumentation:async-http-client:async-http-client-2.0:javaagent'
358+
- type: gradle
359+
path: ./
360+
target: ':instrumentation:async-http-client:async-http-client-common-1.8:javaagent'
361361
- type: gradle
362362
path: ./
363363
target: ':instrumentation:aws-lambda:aws-lambda-core-1.0:javaagent'
@@ -427,9 +427,6 @@ targets:
427427
- type: gradle
428428
path: ./
429429
target: ':instrumentation:clickhouse:clickhouse-client-v2-0.8:javaagent'
430-
- type: gradle
431-
path: ./
432-
target: ':instrumentation:couchbase:couchbase-2-common:javaagent'
433430
- type: gradle
434431
path: ./
435432
target: ':instrumentation:couchbase:couchbase-2.0:javaagent'
@@ -448,6 +445,9 @@ targets:
448445
- type: gradle
449446
path: ./
450447
target: ':instrumentation:couchbase:couchbase-3.4:javaagent'
448+
- type: gradle
449+
path: ./
450+
target: ':instrumentation:couchbase:couchbase-common-2.0:javaagent'
451451
- type: gradle
452452
path: ./
453453
target: ':instrumentation:dropwizard:dropwizard-metrics-4.0:javaagent'
@@ -630,10 +630,10 @@ targets:
630630
target: ':instrumentation:jms:jms-common:javaagent'
631631
- type: gradle
632632
path: ./
633-
target: ':instrumentation:jsf:jsf-jakarta-common:javaagent'
633+
target: ':instrumentation:jsf:jsf-common-javax:javaagent'
634634
- type: gradle
635635
path: ./
636-
target: ':instrumentation:jsf:jsf-javax-common:javaagent'
636+
target: ':instrumentation:jsf:jsf-jakarta-common:javaagent'
637637
- type: gradle
638638
path: ./
639639
target: ':instrumentation:jsf:jsf-mojarra-1.2:javaagent'
@@ -835,9 +835,6 @@ targets:
835835
- type: gradle
836836
path: ./
837837
target: ':instrumentation:opentelemetry-api:opentelemetry-api-1.50:javaagent'
838-
- type: gradle
839-
path: ./
840-
target: ':instrumentation:opentelemetry-api:opentelemetry-api-1.52:javaagent'
841838
- type: gradle
842839
path: ./
843840
target: ':instrumentation:opentelemetry-api:opentelemetry-api-1.56:javaagent'
@@ -1171,9 +1168,6 @@ targets:
11711168
- type: gradle
11721169
path: ./
11731170
target: ':instrumentation:spring:spring-jms:spring-jms-6.0:javaagent'
1174-
- type: gradle
1175-
path: ./
1176-
target: ':instrumentation:spring:spring-web:spring-web-3.1:javaagent'
11771171
- type: gradle
11781172
path: ./
11791173
target: ':instrumentation:spring:spring-web:spring-web-3.1:library'

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

Lines changed: 122 additions & 39 deletions
Large diffs are not rendered by default.

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,15 @@ For each file in scope:
9191
- PR mode: changed lines only
9292
- File/directory mode: all lines
9393
4. Apply checklist rules (below) and insert comments above offending lines.
94-
5. Do not flag a non-capturing lambda or method reference as an unnecessary allocation,
95-
because on modern JDKs these are typically cached at the call site rather than
96-
allocated on every invocation.
97-
6. Flag a missing `// added in X.Y` comment on a single-class lower-bound
98-
`hasClassesNamed(...)` check in `classLoaderMatcher()` only after validating that the
99-
stated version is factually correct from repository or upstream evidence; the comment
100-
documents why the matcher exists and which version boundary it enforces.
94+
5. Do not flag a non-capturing lambda or method reference as an allocation issue.
95+
On HotSpot / OpenJDK 8+, these are cached at the call site.
96+
6. Flag a missing version-boundary comment on a single-class `hasClassesNamed(...)`
97+
check in `classLoaderMatcher()` only after validating the stated boundary from
98+
repository or upstream evidence. Use `// added in X.Y` for a pure lower bound.
99+
If the same positive class also provides the upper bound because it disappears in a
100+
newer sibling version, preserve or request `removed in Y.Z` too. For negated checks
101+
such as `not(hasClassesNamed(...))`, use `// added in Y.Z` because the class's first
102+
appearance is what starts the excluded version range.
101103
7. Prevent duplicates:
102104
- If equivalent `REVIEW:` already exists above the same line, do not add another.
103105

.github/agents/knowledge/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ Load only files relevant to the current scope to reduce noise and avoid over-con
1111
| `api-deprecation-policy.md` | Public API removal, rename, or deprecation; stable vs alpha breaking changes |
1212
| `config-property-stability.md` | `otel.instrumentation.*` property add, remove, rename, or deprecation |
1313
| `general-rules.md` | Always — review checklist table and core rules enforced on every review |
14+
| `metadata-yaml-format.md` | Always — mandatory review of metadata.yaml for config coverage |
1415
| `gradle-conventions.md` | `build.gradle.kts` or `settings.gradle.kts` changes, custom test task registration or wiring |
1516
| `javaagent-advice-patterns.md` | ByteBuddy `@Advice` class or advice-method changes |
16-
| `javaagent-module-patterns.md` | `InstrumentationModule`, `TypeInstrumentation`, `Singletons`, `VirtualField`, `CallDepth` |
17+
| `javaagent-module-patterns.md` | `InstrumentationModule`, `TypeInstrumentation`, `VirtualField`, `CallDepth` |
18+
| `javaagent-singletons-patterns.md` | `*Singletons` holder classes, singleton accessors, callers of singleton accessors/fields |
1719
| `library-patterns.md` | Library instrumentation telemetry, builder, getter, or setter pattern changes |
1820
| `module-naming.md` | New or renamed modules or packages; settings includes |
19-
| `testing-general-patterns.md` | Test files in scope — assertion style, attribute assertion patterns, `satisfies()` lambda usage |
21+
| `testing-general-patterns.md` | Test files in scope — assertion style, test method signatures and throws clauses, resource cleanup patterns, attribute assertion patterns, `satisfies()` lambda usage |
2022
| `testing-experimental-flags.md` | `testExperimental` task or experimental span-attribute assertions |
2123
| `testing-semconv-stability.md` | Semconv opt-in modes, `emitOld*`/`emitStable*`, `maybeStable`, Semconv test tasks |
2224

.github/agents/knowledge/config-property-stability.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Defined in [VERSIONING.md](../../../VERSIONING.md):
5252
Examples (flat ↔ YAML):
5353

5454
- `otel.instrumentation.http.client.capture-request-headers``request_captured_headers`**stable**
55-
- `otel.instrumentation.common.experimental.db-sqlcommenter.enabled``sqlcommenter/development: { enabled: true }`**experimental**
55+
- `otel.instrumentation.common.db.experimental.sqlcommenter.enabled``sqlcommenter/development: { enabled: true }`**experimental**
5656
- `otel.instrumentation.http.client.emit-experimental-telemetry``emit_experimental_telemetry/development: true`**experimental**
5757

5858
## Deprecation Communication

.github/agents/knowledge/general-rules.md

Lines changed: 86 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,26 @@ When a "Knowledge File" is listed, load it from `knowledge/` before reviewing th
1515
| --- | --- | --- | --- |
1616
| General | Logic, correctness, reliability, safety, copy/paste mistakes, incorrect comments | Always ||
1717
| Style | Style guide | Always ||
18-
| Style | Uppercase field names should reflect semantic constants, not simply `static final` | Always ||
18+
| Style | Uppercase field names should reflect semantic constants or immutable value constants such as `Duration` timeouts/intervals, not simply `static final` | Always ||
1919
| Naming | Getter naming (`get` / `is`) | Always ||
20+
| Style | Prefer `e` for used exceptions, prefer `f` for used exceptions in nested catch clauses when an outer catch already uses `e`, allow `error` for specific `*Error` catch types, prefer `t` for used `Throwable` catch values, prefer `ignored` for intentionally unused catch parameters, and use `ignore` for nested intentionally unused catch parameters when `ignored` would shadow an outer catch variable | Catch clauses ||
2021
| Naming | Module/package naming | New or renamed modules/packages | `module-naming.md` |
2122
| Javaagent | Advice patterns | `@Advice` classes | `javaagent-advice-patterns.md` |
22-
| Javaagent | Module structure patterns | `InstrumentationModule`, `TypeInstrumentation`, `Singletons` | `javaagent-module-patterns.md` |
23+
| Javaagent | Module structure patterns | `InstrumentationModule`, `TypeInstrumentation` | `javaagent-module-patterns.md` |
24+
| Javaagent | Singletons patterns | `*Singletons` holder classes, singleton accessors, callers of singleton accessors/fields | `javaagent-singletons-patterns.md` |
2325
| Javaagent | Incorrect `classLoaderMatcher()` | `classLoaderMatcher()` override that is redundant (muzzle already handles it) or missing when needed (muzzle cannot distinguish version range) | `javaagent-module-patterns.md` |
2426
| Semconv | Library vs javaagent semconv constant usage | Semconv constants/assertions ||
2527
| Semconv | Dual semconv testing | `SemconvStability`, `maybeStable`, semconv Gradle tasks | `testing-semconv-stability.md` |
26-
| Testing | General test patterns | Test files in scope | `testing-general-patterns.md` |
28+
| Testing | General test patterns | Test files in scope — assertion style, test method signatures and throws clauses, resource cleanup, attribute assertions | `testing-general-patterns.md` |
2729
| Testing | Experimental flag tests | `testExperimental`, experimental attribute assertions, `experimental` flags in JVM args or system properties | `testing-experimental-flags.md` |
2830
| Library | TelemetryBuilder/getter/setter patterns | Library instrumentation classes | `library-patterns.md` |
2931
| API | Deprecation and breaking-change policy | Public API changes | `api-deprecation-policy.md` |
3032
| Config | Config property stability/renames/removals | `otel.instrumentation.*` property changes, `DeclarativeConfigUtil` or `ConfigProperties` usage | `config-property-stability.md` |
33+
| Config | metadata.yaml format and declarative_name conversion — Mandatory for every instrumentation module | Any instrumentation module in scope (javaagent, library, or testing) | `metadata-yaml-format.md` |
3134
| Build | Gradle conventions, muzzle, test tasks, plugins | `build.gradle.kts`, `settings.gradle.kts` | `gradle-conventions.md` |
3235
| Build | `testcontainersBuildService` declaration | Testcontainers dependency without `usesService` | `gradle-conventions.md` |
3336
| Style | Prefer instance creation over singletons for stateless interface impls (except on hot paths or Kotlin `object` declarations) | `TextMapGetter`, `TextMapSetter`, `*AttributesGetter`, `AttributesExtractor`, `SpanNameExtractor`, `HttpServerResponseMutator`, enum/static singletons ||
37+
| Style | Prefer `value == null` / `value != null` over `null == value` / `null != value` | Null comparisons ||
3438
| Style | No unnecessary explicit type witnesses on generic method calls (`Collections.<String>emptyList()`) | Java generic method calls with explicit type parameters ||
3539
| Style | Remove redundant null guards on attribute puts | `AttributesBuilder.put`, `onStart`, `onEnd`, attribute extraction methods ||
3640
| General | No redundant `ByteBuffer.duplicate()` on `Value.getValue()` | `Value.getValue()` with `BYTES` type, `ByteBuffer` handling ||
@@ -54,13 +58,37 @@ Flag real defects, including:
5458

5559
Only flag substantive problems, not stylistic preference.
5660

61+
## [Javaagent] Best-Effort Suppressed Failures
62+
63+
When javaagent runtime code intentionally suppresses a `Throwable` to avoid breaking the
64+
application, do not silently swallow it unless the failure is an expected optional probe.
65+
66+
- In ordinary instrumentation implementation code, local JUL `logger.log(FINE, ...)` is an
67+
established pattern and preserves module / class logger identity.
68+
- Silent suppression is acceptable for expected optional-probe paths, such as classpath or
69+
version-detection lookups where failure is routine and logging would be noisy.
70+
5771
## [Style] Style Guide
5872

5973
Read and apply `docs/contributing/style-guide.md`.
6074

6175
Do not flag the following patterns (common false positives):
6276

6377
- FQCN is acceptable when class-name collision makes import impossible.
78+
- Do not claim that a Java non-capturing lambda or method reference allocates per
79+
call. On HotSpot / OpenJDK 8+, these are cached at the call site.
80+
81+
## [Style] Visibility modifiers
82+
83+
Follow the principle of minimal necessary visibility. Use the most restrictive access modifier that
84+
still allows the code to function correctly.
85+
86+
**Exception — Single public class**: If a module has only one public class then don't change it to
87+
package-private. Javadoc task fails when module has no public classes.**
88+
89+
**Exception — Used from advice**: All classes and methods used from methods annotated with
90+
`@Advice.OnMethodEnter` or `@Advice.OnMethodExit` must be public. These methods are inlined into
91+
transformed classes and must be accessible from those classes, which may be in different packages.
6492

6593
## [Style] `@SuppressWarnings` Usage
6694

@@ -71,11 +99,44 @@ Do not flag the following patterns (common false positives):
7199
The project disables javac's `-Xlint:deprecation` globally and uses a custom Error Prone
72100
check (`OtelDeprecatedApiUsage`) instead. Only add the annotation when it is actually
73101
required to fix an Error Prone error — not speculatively.
102+
- Preserve concise explanatory comments attached to existing `@SuppressWarnings` annotations
103+
when they explain why the suppression exists (for example `// using deprecated semconv`
104+
or `// using deprecated config property`). This repository has established precedent for
105+
such comments, and test code disables Error Prone's `SuppressWarningsWithoutExplanation`
106+
check only because enforcing it everywhere causes too many failures, not because these
107+
comments are undesirable.
108+
- When normalizing or moving an existing `@SuppressWarnings`, keep any accurate explanatory
109+
comment with it. Remove the comment only if it is incorrect, obsolete, or contradicted by
110+
the code after your change.
74111

75112
## [Naming] Getter Naming
76113

77114
Public API getters should use `get*` (or `is*` for booleans).
78115

116+
## [Style] Catch Exception Variable Naming
117+
118+
Prefer `e` as the exception variable name in catch clauses when the exception is
119+
used.
120+
121+
For nested catch clauses, when an outer catch already uses `e`, prefer `f` as the
122+
inner exception variable name when the exception is used.
123+
124+
`error` is also acceptable when the caught type is a specific `*Error` subtype.
125+
126+
Prefer `t` for used `Throwable` catch values, including `catch (Throwable t)`.
127+
128+
Do not apply these catch-variable naming preferences to method parameters,
129+
lambda parameters, fields, or other non-catch identifiers.
130+
131+
If a catch parameter is intentionally unused, prefer `ignored` over `ignore`.
132+
133+
For nested catch clauses, if `ignored` would shadow an outer catch variable,
134+
prefer `ignore` for the inner intentionally unused catch parameter.
135+
136+
Both `ignored` and `ignore` are recognized by IntelliJ's `CatchMayIgnoreException`
137+
inspection as intentional unused-catch names. In test sources, IntelliJ also
138+
recognizes `expected` and `ok`.
139+
79140
## [Style] Prefer Instance Creation Over Singletons
80141

81142
Stateless implementations of telemetry interfaces — `TextMapGetter`, `TextMapSetter`,
@@ -108,6 +169,11 @@ All `put` / `setAttribute` methods on `AttributesBuilder`, `Span`, `SpanBuilder`
108169
`LogRecordBuilder` are no-ops when the value is `null` (upstream SDK guarantee).
109170
Do not wrap these calls in `if (value != null)` guards — pass the value directly.
110171

172+
This rule applies only when the guarded value can be passed through directly to the
173+
attribute setter. If the null check is guarding a dereference or other derived
174+
computation, keep the explicit guard instead of rewriting it into a ternary
175+
expression just to feed `null` to `put()`.
176+
111177
**Exception — `AttributeKey<Long>` with `Integer` value**: the only primitive-typed
112178
overload on these interfaces is a convenience method that accepts `int`:
113179

@@ -142,6 +208,16 @@ Preferred:
142208
attributes.put(SOME_KEY, getSomething());
143209
```
144210

211+
Do **not** flag (the guard is preserving a safe dereference and is clearer than a
212+
ternary rewrite):
213+
214+
```java
215+
View view = modelAndView.getView();
216+
if (view != null) {
217+
attributes.put("spring-webmvc.view.type", view.getClass().getName());
218+
}
219+
```
220+
145221
Also flag (the guard is unnecessary — types match, generic overload handles null):
146222

147223
```java
@@ -323,6 +399,13 @@ instrumentation enable/disable bootstrapping (`otel.instrumentation.<name>.enabl
323399
`otel.instrumentation.common.default-enabled`). All other config reads go through the
324400
declarative API. Do not flag `DeclarativeConfigUtil` usage as incorrect.
325401

402+
## [Config] Mandatory metadata.yaml Review
403+
404+
**For every instrumentation module in scope, you MUST review and update its `metadata.yaml` file.**
405+
406+
This is mandatory regardless of whether metadata.yaml was modified in the PR. Load
407+
`metadata-yaml-format.md` and execute its full validation procedure for each module.
408+
326409
## [Testing] General Test Patterns
327410

328411
See `testing-general-patterns.md` (loaded when test files are in scope).

0 commit comments

Comments
 (0)