Skip to content

Code review sweep (run 24946562825)#18304

Merged
trask merged 5 commits into
mainfrom
otelbot/code-review-sweep-24946562825
Apr 26, 2026
Merged

Code review sweep (run 24946562825)#18304
trask merged 5 commits into
mainfrom
otelbot/code-review-sweep-24946562825

Conversation

@otelbot
Copy link
Copy Markdown
Contributor

@otelbot otelbot Bot commented Apr 26, 2026

Automated code review sweep walked the following modules in order
and stopped after accumulating at least 10 modified files:

  • aws-lambda-events-2.2:library
  • aws-lambda-events-2.2:testing
  • aws-lambda-events-3.11:library
  • aws-lambda-events-common-2.2:library
  • aws-sdk-1.11:javaagent
  • aws-sdk-1.11:library

Module: aws-lambda-events-2.2:library

Module path: instrumentation/aws-lambda/aws-lambda-events-2.2/library

Summary

Added missing declarative_name mappings in instrumentation/aws-lambda/aws-lambda-events-2.2/metadata.yaml so the module's documented config keys follow the mandatory metadata format and pass declarative-config validation.

Applied Changes

Config

File: metadata.yaml:11
Change: Added `declarative_name: java.aws_lambda.flush_timeout` for `otel.instrumentation.aws-lambda.flush-timeout` and `declarative_name: java.common.http.known_methods` for `otel.instrumentation.http.known-methods`.
Reason: `metadata-yaml-format.md` requires active instrumentation config entries to declare the correct `declarative_name`, and `general-rules.md` makes `metadata.yaml` validation mandatory for every instrumentation module in scope.

Module: aws-lambda-events-2.2:testing

Module path: instrumentation/aws-lambda/aws-lambda-events-2.2/testing

Summary

No safe repository-guideline fixes were needed under instrumentation/aws-lambda/aws-lambda-events-2.2/testing; the scoped build.gradle.kts, AbstractAwsLambdaSqsEventHandlerTest.java, and module metadata.yaml review did not reveal any deterministic issues to change.

Applied Changes

No safe automated changes were applied.

Module: aws-lambda-events-3.11:library

Module path: instrumentation/aws-lambda/aws-lambda-events-3.11/library

Summary

Applied one safe review fix in instrumentation/aws-lambda/aws-lambda-events-3.11 by adding the missing declarative_name for the existing otel.instrumentation.aws-lambda.flush-timeout metadata entry so the module's declarative-config metadata matches repository metadata.yaml rules and validation.

Applied Changes

Config

File: metadata.yaml:10
Change: Added `declarative_name: java.aws_lambda.flush_timeout` to the `otel.instrumentation.aws-lambda.flush-timeout` configuration entry.
Reason: `knowledge/metadata-yaml-format.md` makes `declarative_name` mandatory for instrumentation module config entries and requires validating the flat-property-to-declarative mapping against actual config usage; this property is used by the AWS Lambda wrapper flush-timeout configuration and had no declarative mapping.

Module: aws-lambda-events-common-2.2:library

Module path: instrumentation/aws-lambda/aws-lambda-events-common-2.2/library

Summary

Applied 2 safe review fixes in aws-lambda-events-common-2.2 library: tightened CustomJodaModule visibility and removed a per-message MapGetter allocation from SQS span-link extraction.

Applied Changes

Style

File: CustomJodaModule.java:36
Change: Reduced `CustomJodaModule()` visibility from `public` to package-private.
Reason: The style guide requires minimal necessary visibility, and this package-private class is only instantiated within the same package.

Performance

File: SqsMessageSpanLinksExtractor.java:24
Change: Reused a single `MapGetter` instance instead of allocating `new MapGetter()` on every `extract()` call.
Reason: The style guide says to avoid allocations on the hot path, and the review rule for stateless `TextMapGetter` implementations keeps a shared instance for per-message propagation paths.

Module: aws-sdk-1.11:javaagent

Module path: instrumentation/aws-sdk/aws-sdk-1.11/javaagent

Summary

Applied 2 safe review fixes in instrumentation/aws-sdk/aws-sdk-1.11/javaagent after reviewing the module and its metadata.yaml; required Gradle validation completed successfully.

Applied Changes

Javaagent

File: SqsInstrumentationModule.java:30
Change: Removed `suppress = Throwable.class` from `RegisterAdvice`.
Reason: `javaagent-advice-patterns.md` says helper-injection-only advice attached with `none()` never executes, so `suppress` is meaningless noise there.

Testing

File: Aws0ClientTest.java:118
Change: Narrowed reflective test `throws` clauses to `ReflectiveOperationException` and replaced `stream().findFirst().get()` with direct `get(0)` access after size assertions.
Reason: `testing-general-patterns.md` prefers a single specific checked exception on test methods, and direct list access is clearer once `hasSize(...)` has already established that the handler list is non-empty.

Module: aws-sdk-1.11:library

Module path: instrumentation/aws-sdk/aws-sdk-1.11/library

Summary

Applied safe scoped review fixes under instrumentation/aws-sdk/aws-sdk-1.11/library by tightening internal helper visibility, normalizing intentionally unused catch variables to ignored, and correcting inaccurate PluginImplUtil comments.

Applied Changes

Style

File: AbstractSqsRequest.java:12
Change: Reduced `AbstractSqsRequest.getRequest()` from `public` to package-private.
Reason: The style guide requires minimal necessary visibility, and this abstract helper is package-private and only used within the package.

File: AwsSdkAttributesExtractor.java:122
Change: Reduced the internal `setAttribute()` helper from `public static` to `private static`.
Reason: The style guide requires minimal necessary visibility, and this helper is only called inside `AwsSdkAttributesExtractor`.

File: RequestAccess.java:125
Change: Renamed unused caught `Throwable` variables to `ignored`.
Reason: The general rules prefer `ignored` for intentionally unused catch parameters.

File: SqsImpl.java:89
Change: Renamed the unused caught exception variable in `getMessagesField()` to `ignored`.
Reason: The general rules prefer `ignored` for intentionally unused catch parameters.

File: SqsProcessRequest.java:14
Change: Reduced `SqsProcessRequest` factory and accessors from `public` to package-private.
Reason: The style guide requires minimal necessary visibility for helpers inside package-private types.

File: SqsReceiveRequest.java:15
Change: Reduced `SqsReceiveRequest` factory and accessors from `public` to package-private.
Reason: The style guide requires minimal necessary visibility for helpers inside package-private types.

File: TracingIterator.java:46
Change: Reduced `TracingIterator.wrap()` from `public` to package-private.
Reason: The style guide requires minimal necessary visibility, and this factory is only used within the package.

File: TracingList.java:41
Change: Reduced `TracingList.wrap()` from `public` to package-private.
Reason: The style guide requires minimal necessary visibility, and this factory is only used within the package.

General

File: PluginImplUtil.java:12
Change: Fixed inaccurate `PluginImplUtil` comments and removed the leftover copy-paste note on the class declaration.
Reason: The general review rules require correcting incorrect comments so documentation matches the current code.


Download code review diagnostics

otelbot Bot added 5 commits April 26, 2026 03:00
Automated code review of instrumentation/aws-lambda/aws-lambda-events-2.2/library.
Automated code review of instrumentation/aws-lambda/aws-lambda-events-3.11/library.
Automated code review of instrumentation/aws-lambda/aws-lambda-events-common-2.2/library.
Automated code review of instrumentation/aws-sdk/aws-sdk-1.11/javaagent.
Automated code review of instrumentation/aws-sdk/aws-sdk-1.11/library.
@otelbot otelbot Bot requested a review from a team as a code owner April 26, 2026 03:29
@trask trask enabled auto-merge (squash) April 26, 2026 03:55
@trask trask merged commit 8017cf1 into main Apr 26, 2026
180 of 182 checks passed
@trask trask deleted the otelbot/code-review-sweep-24946562825 branch April 26, 2026 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant