Skip to content

Commit 1714d47

Browse files
authored
Code review sweep (run 24945510626) (#18303)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
1 parent ec3f0c2 commit 1714d47

10 files changed

Lines changed: 17 additions & 19 deletions

File tree

instrumentation/avaje-jex-3.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/avaje/jex/v3_0/JexInstrumentationModule.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
1313
import java.util.List;
1414

15-
@SuppressWarnings("unused")
1615
@AutoService(InstrumentationModule.class)
1716
public class JexInstrumentationModule extends InstrumentationModule {
1817

instrumentation/aws-lambda/aws-lambda-core-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/awslambdacore/v1_0/AwsLambdaInstrumentationModule.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,10 @@ public AwsLambdaInstrumentationModule() {
2424

2525
@Override
2626
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
27-
return hasClassesNamed(
28-
// added in 1.0.0
29-
"com.amazonaws.services.lambda.runtime.RequestHandler")
30-
.and(
31-
not(
32-
hasClassesNamed(
33-
// added in 2.2.0 (in which case aws-lambda-events-2.2 is used)
34-
"com.amazonaws.services.lambda.runtime.events.SQSEvent")));
27+
// added in 1.0.0
28+
return hasClassesNamed("com.amazonaws.services.lambda.runtime.RequestHandler")
29+
// added in 2.2.0 (in which case aws-lambda-events-2.2 is used)
30+
.and(not(hasClassesNamed("com.amazonaws.services.lambda.runtime.events.SQSEvent")));
3531
}
3632

3733
@Override

instrumentation/aws-lambda/aws-lambda-core-1.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/awslambdacore/v1_0/AwsLambdaStreamHandlerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void tearDown() {
5555
}
5656

5757
@Test
58-
void handlerTraced() throws Exception {
58+
void handlerTraced() throws IOException {
5959
InputStream input = new ByteArrayInputStream("hello\n".getBytes(UTF_8));
6060
OutputStream output = new ByteArrayOutputStream();
6161
RequestStreamHandlerTestImpl handler = new RequestStreamHandlerTestImpl();

instrumentation/aws-lambda/aws-lambda-core-1.0/library/src/main/java/io/opentelemetry/instrumentation/awslambdacore/v1_0/internal/WrapperConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
*/
1414
public final class WrapperConfiguration {
1515

16-
private WrapperConfiguration() {}
17-
1816
public static final String OTEL_LAMBDA_FLUSH_TIMEOUT_ENV_KEY =
1917
"OTEL_INSTRUMENTATION_AWS_LAMBDA_FLUSH_TIMEOUT";
2018
public static final Duration OTEL_LAMBDA_FLUSH_TIMEOUT_DEFAULT = Duration.ofSeconds(10);
@@ -30,4 +28,6 @@ public static Duration flushTimeout() {
3028
}
3129
return OTEL_LAMBDA_FLUSH_TIMEOUT_DEFAULT;
3230
}
31+
32+
private WrapperConfiguration() {}
3333
}

instrumentation/aws-lambda/aws-lambda-core-1.0/library/src/test/java/io/opentelemetry/instrumentation/awslambdacore/v1_0/AwsLambdaStreamWrapperHttpPropagationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void tearDown() {
6666
}
6767

6868
@Test
69-
void handlerTraced() throws Exception {
69+
void handlerTraced() throws IOException {
7070
String content =
7171
"{"
7272
+ "\"headers\" : {"

instrumentation/aws-lambda/aws-lambda-core-1.0/library/src/test/java/io/opentelemetry/instrumentation/awslambdacore/v1_0/AwsLambdaStreamWrapperTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void tearDown() {
6565
}
6666

6767
@Test
68-
void handlerTraced() throws Exception {
68+
void handlerTraced() throws IOException {
6969
InputStream input = new ByteArrayInputStream("hello\n".getBytes(UTF_8));
7070
OutputStream output = new ByteArrayOutputStream();
7171

instrumentation/aws-lambda/aws-lambda-core-1.0/metadata.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ semantic_conventions:
1414
library_link: https://docs.aws.amazon.com/lambda/latest/dg/java-handler.html
1515
configurations:
1616
- name: otel.instrumentation.aws-lambda.flush-timeout
17+
declarative_name: java.aws_lambda.flush_timeout
1718
type: int
1819
default: 10000
1920
description: Flush timeout in milliseconds.

instrumentation/aws-lambda/aws-lambda-events-2.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/awslambdaevents/v2_2/AwsLambdaRequestHandlerInstrumentation.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ public static class AdviceScope {
5959
private final AwsLambdaRequest lambdaRequest;
6060
private final Scope functionScope;
6161
private final io.opentelemetry.context.Context functionContext;
62-
private final Scope messageScope;
63-
private final io.opentelemetry.context.Context messageContext;
62+
@Nullable private final Scope messageScope;
63+
@Nullable private final io.opentelemetry.context.Context messageContext;
6464

6565
private AdviceScope(
6666
AwsLambdaRequest lambdaRequest,
6767
io.opentelemetry.context.Context functionContext,
6868
Scope functionScope,
69-
io.opentelemetry.context.Context messageContext,
70-
Scope messageScope) {
69+
@Nullable io.opentelemetry.context.Context messageContext,
70+
@Nullable Scope messageScope) {
7171
this.lambdaRequest = lambdaRequest;
7272
this.functionContext = functionContext;
7373
this.functionScope = functionScope;

instrumentation/aws-lambda/aws-lambda-events-2.2/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/awslambdaevents/v2_2/AwsLambdaStreamHandlerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void tearDown() {
5555
}
5656

5757
@Test
58-
void handlerTraced() throws Exception {
58+
void handlerTraced() throws IOException {
5959
InputStream input = new ByteArrayInputStream("hello\n".getBytes(UTF_8));
6060
OutputStream output = new ByteArrayOutputStream();
6161
RequestStreamHandlerTestImpl handler = new RequestStreamHandlerTestImpl();

instrumentation/aws-lambda/aws-lambda-events-2.2/metadata.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ semantic_conventions:
99
library_link: https://docs.aws.amazon.com/lambda/latest/dg/java-handler.html
1010
configurations:
1111
- name: otel.instrumentation.aws-lambda.flush-timeout
12+
declarative_name: java.aws_lambda.flush_timeout
1213
type: int
1314
default: 10000
1415
description: Flush timeout in milliseconds.
1516
- name: otel.instrumentation.http.known-methods
17+
declarative_name: java.common.http.known_methods
1618
description: >
1719
Configures the instrumentation to recognize an alternative set of HTTP request methods. All
1820
other methods will be treated as `_OTHER`.

0 commit comments

Comments
 (0)