Skip to content

Commit 54ce983

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/nodejs/opentelemetry-deps-nodejs-ab25c0e567
2 parents e4c9931 + 250c391 commit 54ce983

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

java/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ For more information about the idea behind this optimization, you can check the
4141

4242
### Wrapper
4343

44-
[OpenTelemetry Lambda Instrumentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/aws-lambda-1.0/library)
44+
[OpenTelemetry Lambda Instrumentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/aws-lambda)
4545
and [OpenTelemetry SDK](https://github.com/open-telemetry/opentelemetry-java) are bundled into the
4646
`java/lib` directory to be available on the classpath of the Lambda function. No code change is
4747
needed to instrument the execution of your function, but you will need to set the `AWS_LAMBDA_EXEC_WRAPPER`

java/dependencyManagement/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99
data class DependencySet(val group: String, val version: String, val modules: List<String>)
1010

1111
val DEPENDENCY_BOMS = listOf(
12-
"io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:2.12.0-alpha",
12+
"io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:2.14.0-alpha",
1313
"org.apache.logging.log4j:log4j-bom:2.24.3",
1414
"software.amazon.awssdk:bom:2.31.16"
1515
)
@@ -18,9 +18,9 @@ val DEPENDENCIES = listOf(
1818
"com.amazonaws:aws-lambda-java-core:1.2.3",
1919
"com.amazonaws:aws-lambda-java-events:3.15.0",
2020
"com.squareup.okhttp3:okhttp:4.12.0",
21-
"io.opentelemetry.javaagent:opentelemetry-javaagent:2.12.0",
21+
"io.opentelemetry.javaagent:opentelemetry-javaagent:2.14.0",
2222
"io.opentelemetry:opentelemetry-sdk-extension-aws:1.19.0",
23-
"io.opentelemetry.contrib:opentelemetry-aws-resources:1.43.0-alpha",
23+
"io.opentelemetry.contrib:opentelemetry-aws-resources:1.45.0-alpha",
2424
)
2525

2626
javaPlatform {

java/sample-apps/okhttp/src/main/java/io/opentelemetry/lambda/sampleapps/okhttp/OkHttpRequestHandler.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import io.opentelemetry.instrumentation.okhttp.v3_0.OkHttpTelemetry;
99
import java.io.IOException;
1010
import java.io.UncheckedIOException;
11+
import okhttp3.Call;
1112
import okhttp3.OkHttpClient;
1213
import okhttp3.Request;
1314
import okhttp3.Response;
@@ -24,15 +25,14 @@ public APIGatewayProxyResponseEvent handleRequest(
2425
APIGatewayProxyRequestEvent input, Context context) {
2526
logger.info("Serving lambda request.");
2627

27-
OkHttpClient client =
28-
new OkHttpClient.Builder()
29-
.addInterceptor(OkHttpTelemetry.create(GlobalOpenTelemetry.get()).newInterceptor())
30-
.build();
28+
OkHttpClient baseClient = new OkHttpClient();
29+
Call.Factory callFactory =
30+
OkHttpTelemetry.create(GlobalOpenTelemetry.get()).newCallFactory(baseClient);
3131

3232
APIGatewayProxyResponseEvent response = new APIGatewayProxyResponseEvent();
3333

3434
Request request = new Request.Builder().url("https://aws.amazon.com/").build();
35-
try (Response okhttpResponse = client.newCall(request).execute()) {
35+
try (Response okhttpResponse = callFactory.newCall(request).execute()) {
3636
response.setBody(
3737
"Hello lambda - fetched " + okhttpResponse.body().string().length() + " bytes.");
3838
} catch (IOException e) {

0 commit comments

Comments
 (0)