Skip to content

aws-sdk-2.2: remove *AdviceBridge classes living in non-standard javaagent package#18915

Merged
laurit merged 1 commit into
open-telemetry:mainfrom
trask:aws-sdk-2.2-remove-advice-bridges
Jun 8, 2026
Merged

aws-sdk-2.2: remove *AdviceBridge classes living in non-standard javaagent package#18915
laurit merged 1 commit into
open-telemetry:mainfrom
trask:aws-sdk-2.2-remove-advice-bridges

Conversation

@trask

@trask trask commented Jun 5, 2026

Copy link
Copy Markdown
Member

Part of #18428.

The four *AdviceBridge classes live in the javaagent module under io.opentelemetry.instrumentation.awssdk.v2_2.internal — i.e. under the library's package namespace, not the javaagent's standard io.opentelemetry.javaagent.instrumentation.awssdk.v2_2.* — purely so each one can call a package-private *Impl sibling for muzzle. This is why the package-name checker (#18428) still needs a carveout for this module.

Promoting LambdaImpl and SnsImpl to public (joining SqsImpl and BedrockRuntimeImpl) lets each agent *InstrumentationModule.RegisterAdvice reference its *Impl class directly, and the four bridge files go away. The internal package is documented as not-for-public-use, so the visibility change doesn't expand the public API.

Promotes `LambdaImpl` and `SnsImpl` from package-private to `public` in the
`…v2_2.internal` package (joining the already-public `SqsImpl` and
`BedrockRuntimeImpl`), so each agent `*InstrumentationModule.RegisterAdvice`
can reference its `*Impl` class directly for muzzle. Removes the four
`*AdviceBridge` helper classes that previously hopped through the library
package to access these package-private types.

The `internal` package is documented as not-for-public-use, so promoting the
visibility doesn't expand the public API surface.
@trask trask changed the title Remove aws-sdk-2.2 advice bridges; reference *Impl classes directly aws-sdk-2.2: remove *AdviceBridge classes living in non-standard javaagent package Jun 6, 2026
@trask trask marked this pull request as ready for review June 6, 2026 00:51
@trask trask requested a review from a team as a code owner June 6, 2026 00:51
Copilot AI review requested due to automatic review settings June 6, 2026 00:51

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.

Pull request overview

This PR removes the aws-sdk-2.2 javaagent’s *AdviceBridge classes that were living under the library namespace (io.opentelemetry.instrumentation.*) by updating the javaagent modules to reference the corresponding *Impl classes directly. This aligns the javaagent module’s packages with the project’s standard io.opentelemetry.javaagent.instrumentation.* namespace while preserving the existing muzzle/reference pattern.

Changes:

  • Promote LambdaImpl and SnsImpl to public (still in an .internal package with an “internal/unstable” warning) so the javaagent can reference them directly.
  • Update the four *InstrumentationModule classes to reference *Impl directly (instead of going through *AdviceBridge) for muzzle/reference purposes.
  • Delete the four *AdviceBridge classes from the javaagent module.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/internal/SnsImpl.java Make SnsImpl public and document it as internal/unstable.
instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/internal/LambdaImpl.java Make LambdaImpl public and document it as internal/unstable.
instrumentation/aws-sdk/aws-sdk-2.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/awssdk/v2_2/SqsInstrumentationModule.java Replace bridge reference with direct SqsImpl reference for muzzle.
instrumentation/aws-sdk/aws-sdk-2.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/awssdk/v2_2/SnsInstrumentationModule.java Replace bridge reference with direct SnsImpl reference for muzzle.
instrumentation/aws-sdk/aws-sdk-2.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/awssdk/v2_2/LambdaInstrumentationModule.java Replace bridge reference with direct LambdaImpl reference for muzzle.
instrumentation/aws-sdk/aws-sdk-2.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/awssdk/v2_2/BedrockRuntimeInstrumentationModule.java Replace bridge reference with direct BedrockRuntimeImpl reference for muzzle.
instrumentation/aws-sdk/aws-sdk-2.2/javaagent/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/internal/SqsAdviceBridge.java Deleted; no longer needed after direct SqsImpl reference.
instrumentation/aws-sdk/aws-sdk-2.2/javaagent/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/internal/SnsAdviceBridge.java Deleted; no longer needed after direct SnsImpl reference.
instrumentation/aws-sdk/aws-sdk-2.2/javaagent/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/internal/LambdaAdviceBridge.java Deleted; no longer needed after direct LambdaImpl reference.
instrumentation/aws-sdk/aws-sdk-2.2/javaagent/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/internal/BedrockRuntimeAdviceBridge.java Deleted; no longer needed after direct BedrockRuntimeImpl reference.

@laurit laurit merged commit bf10af7 into open-telemetry:main Jun 8, 2026
95 checks passed
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.

3 participants