Skip to content

Commit d582535

Browse files
committed
Merge branch 'main' of github.com:open-telemetry/opentelemetry-java-instrumentation into jmx-metrics-advice
2 parents 21dda9d + 34579d5 commit d582535

File tree

14 files changed

+178
-13
lines changed

14 files changed

+178
-13
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
release:
2222
permissions:
2323
contents: write # for creating the release
24-
runs-on: oracle-8cpu-32gb-x86-64
24+
runs-on: ubuntu-latest
2525
needs:
2626
- common
2727
outputs:

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Unreleased
44

5-
## Version 2.17.0 (2025-06-18)
5+
## Version 2.17.0 (2025-06-20)
66

77
### Migration notes
88

benchmark-overhead-jmh/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ otelJava {
1313
}
1414

1515
dependencies {
16-
jmhImplementation("org.springframework.boot:spring-boot-starter-web:3.5.1")
16+
jmhImplementation("org.springframework.boot:spring-boot-starter-web:3.5.3")
1717
}
1818

1919
tasks {
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Comparing source compatibility of opentelemetry-instrumentation-annotations-2.17.0.jar against opentelemetry-instrumentation-annotations-2.16.0.jar
2+
No changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Comparing source compatibility of opentelemetry-instrumentation-api-2.17.0.jar against opentelemetry-instrumentation-api-2.16.0.jar
2+
No changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Comparing source compatibility of opentelemetry-spring-boot-autoconfigure-2.17.0.jar against opentelemetry-spring-boot-autoconfigure-2.16.0.jar
2+
No changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Comparing source compatibility of opentelemetry-spring-boot-starter-2.17.0.jar against opentelemetry-spring-boot-starter-2.16.0.jar
2+
No changes.

instrumentation/aws-sdk/aws-sdk-1.11/library/build.gradle.kts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ dependencies {
2323
latestDepTestLibrary("com.amazonaws:aws-java-sdk-sqs:1.12.583") // documented limitation
2424
}
2525

26-
if (!(findProperty("testLatestDeps") as Boolean)) {
26+
val testLatestDeps = findProperty("testLatestDeps") as Boolean
27+
if (!testLatestDeps) {
2728
configurations.testRuntimeClasspath {
2829
resolutionStrategy {
2930
eachDependency {
@@ -36,12 +37,26 @@ if (!(findProperty("testLatestDeps") as Boolean)) {
3637
}
3738
}
3839

40+
testing {
41+
suites {
42+
val testSecretsManager by registering(JvmTestSuite::class) {
43+
dependencies {
44+
implementation(project())
45+
implementation(project(":instrumentation:aws-sdk:aws-sdk-1.11:testing"))
46+
version = if (testLatestDeps) "latest.release" else "1.12.80"
47+
implementation("com.amazonaws:aws-java-sdk-secretsmanager:$version")
48+
}
49+
}
50+
}
51+
}
52+
3953
tasks {
4054
val testStableSemconv by registering(Test::class) {
4155
jvmArgs("-Dotel.semconv-stability.opt-in=database")
4256
}
4357

4458
check {
59+
dependsOn(testing.suites)
4560
dependsOn(testStableSemconv)
4661
}
4762
}

instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsSdkAttributesExtractor.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class AwsSdkAttributesExtractor implements AttributesExtractor<Request<?>, Respo
2424
private static final AttributeKey<String> AWS_REQUEST_ID = stringKey("aws.request_id");
2525

2626
// Copied from AwsIncubatingAttributes
27+
private static final AttributeKey<String> AWS_SECRETSMANAGER_SECRET_ARN =
28+
stringKey("aws.secretsmanager.secret.arn");
2729
private static final AttributeKey<String> AWS_STEP_FUNCTIONS_ACTIVITY_ARN =
2830
stringKey("aws.step_functions.activity.arn");
2931
private static final AttributeKey<String> AWS_STEP_FUNCTIONS_STATE_MACHINE_ARN =
@@ -62,8 +64,9 @@ public void onEnd(
6264
Request<?> request,
6365
@Nullable Response<?> response,
6466
@Nullable Throwable error) {
65-
if (response != null) {
66-
Object awsResp = response.getAwsResponse();
67+
Object awsResp = getAwsResponse(response);
68+
if (awsResp != null) {
69+
setAttribute(attributes, AWS_SECRETSMANAGER_SECRET_ARN, awsResp, RequestAccess::getSecretArn);
6770
setAttribute(
6871
attributes,
6972
AWS_STEP_FUNCTIONS_STATE_MACHINE_ARN,
@@ -106,4 +109,11 @@ public static void setAttribute(
106109
attributes.put(key, value);
107110
}
108111
}
112+
113+
private static Object getAwsResponse(Response<?> response) {
114+
if (response == null) {
115+
return null;
116+
}
117+
return response.getAwsResponse();
118+
}
109119
}

instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/RequestAccess.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import javax.annotation.Nullable;
1212

1313
final class RequestAccess {
14+
private static final String SECRETS_MANAGER_REQUEST_CLASS_PREFIX =
15+
"com.amazonaws.services.secretsmanager.model.";
1416
private static final String STEP_FUNCTIONS_REQUEST_CLASS_PREFIX =
1517
"com.amazonaws.services.stepfunctions.model.";
1618

@@ -22,20 +24,20 @@ protected RequestAccess computeValue(Class<?> type) {
2224
}
2325
};
2426

27+
@Nullable
28+
static String getSecretArn(Object request) {
29+
RequestAccess access = REQUEST_ACCESSORS.get(request.getClass());
30+
return invokeOrNull(access.getSecretArn, request);
31+
}
32+
2533
@Nullable
2634
static String getStepFunctionsActivityArn(Object request) {
27-
if (request == null) {
28-
return null;
29-
}
3035
RequestAccess access = REQUEST_ACCESSORS.get(request.getClass());
3136
return invokeOrNull(access.getStepFunctionsActivityArn, request);
3237
}
3338

3439
@Nullable
3540
static String getStateMachineArn(Object request) {
36-
if (request == null) {
37-
return null;
38-
}
3941
RequestAccess access = REQUEST_ACCESSORS.get(request.getClass());
4042
return invokeOrNull(access.getStateMachineArn, request);
4143
}
@@ -97,6 +99,7 @@ private static String invokeOrNull(@Nullable MethodHandle method, Object obj) {
9799
@Nullable private final MethodHandle getBucketName;
98100
@Nullable private final MethodHandle getQueueUrl;
99101
@Nullable private final MethodHandle getQueueName;
102+
@Nullable private final MethodHandle getSecretArn;
100103
@Nullable private final MethodHandle getStreamName;
101104
@Nullable private final MethodHandle getTableName;
102105
@Nullable private final MethodHandle getTopicArn;
@@ -112,6 +115,9 @@ private RequestAccess(Class<?> clz) {
112115
getTableName = findAccessorOrNull(clz, "getTableName");
113116
getTopicArn = findAccessorOrNull(clz, "getTopicArn");
114117
getTargetArn = findAccessorOrNull(clz, "getTargetArn");
118+
119+
boolean isSecretsManager = clz.getName().startsWith(SECRETS_MANAGER_REQUEST_CLASS_PREFIX);
120+
getSecretArn = isSecretsManager ? findAccessorOrNull(clz, "getARN") : null;
115121
boolean isStepFunction = clz.getName().startsWith(STEP_FUNCTIONS_REQUEST_CLASS_PREFIX);
116122
getStateMachineArn = isStepFunction ? findAccessorOrNull(clz, "getStateMachineArn") : null;
117123
getStepFunctionsActivityArn = isStepFunction ? findAccessorOrNull(clz, "getActivityArn") : null;

0 commit comments

Comments
 (0)