From 84699838fc0bcb58a72baa8152027f3e1e6cd364 Mon Sep 17 00:00:00 2001
From: Michael He <53622546+yiyuan-he@users.noreply.github.com>
Date: Thu, 21 Nov 2024 15:13:59 -0800
Subject: [PATCH] Add Contract Tests for LLM Attributes and Models (#952)
*Description of changes:*
Add new contract tests for Gen AI attributes and models.
*Test Plan:*
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
---
.../opentelemetry-java-instrumentation.patch | 2947 +++++------------
.../test/awssdk/base/AwsSdkBaseTest.java | 374 ++-
.../test/awssdk/v1/AwsSdkV1Test.java | 29 +-
.../test/awssdk/v2/AwsSdkV2Test.java | 37 +-
.../utils/SemanticConventionsConstants.java | 6 +
.../main/java/com/amazon/sampleapp/Utils.java | 66 +-
.../main/java/com/amazon/sampleapp/App.java | 173 +
.../main/java/com/amazon/sampleapp/App.java | 166 +
8 files changed, 1750 insertions(+), 2048 deletions(-)
diff --git a/.github/patches/opentelemetry-java-instrumentation.patch b/.github/patches/opentelemetry-java-instrumentation.patch
index 98f517c572..45e804a057 100644
--- a/.github/patches/opentelemetry-java-instrumentation.patch
+++ b/.github/patches/opentelemetry-java-instrumentation.patch
@@ -1,5 +1,5 @@
diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/build.gradle.kts b/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/build.gradle.kts
-index f357a19f88..8a78577580 100644
+index f357a19f88..fa90530579 100644
--- a/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/build.gradle.kts
+++ b/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/build.gradle.kts
@@ -47,6 +47,14 @@ dependencies {
@@ -8,7 +8,7 @@ index f357a19f88..8a78577580 100644
testLibrary("com.amazonaws:aws-java-sdk-sns:1.11.106")
+ testLibrary("com.amazonaws:aws-java-sdk-sqs:1.11.106")
+ testLibrary("com.amazonaws:aws-java-sdk-secretsmanager:1.11.309")
-+ // testLibrary("com.amazonaws:aws-java-sdk-stepfunctions:1.11.230")
++ testLibrary("com.amazonaws:aws-java-sdk-stepfunctions:1.11.230")
+ testLibrary("com.amazonaws:aws-java-sdk-lambda:1.11.678")
+ testLibrary("com.amazonaws:aws-java-sdk-bedrock:1.12.744")
+ testLibrary("com.amazonaws:aws-java-sdk-bedrockagent:1.12.744")
@@ -18,1765 +18,63 @@ index f357a19f88..8a78577580 100644
testImplementation(project(":instrumentation:aws-sdk:aws-sdk-1.11:testing"))
diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/test/groovy/S3TracingTest.groovy b/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/test/groovy/S3TracingTest.groovy
-index 987a50ed95..a39b216252 100644
+index 987a50ed95..889c856a7c 100644
--- a/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/test/groovy/S3TracingTest.groovy
+++ b/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/test/groovy/S3TracingTest.groovy
-@@ -19,679 +19,679 @@ class S3TracingTest extends AgentInstrumentationSpecification {
- awsConnector.disconnect()
- }
-
-- def "S3 upload triggers SQS message"() {
-- setup:
-- String queueName = "s3ToSqsTestQueue"
-- String bucketName = "otel-s3-to-sqs-test-bucket"
-+ //def "S3 upload triggers SQS message"() {
-+ // setup:
-+ // String queueName = "s3ToSqsTestQueue"
-+ // String bucketName = "otel-s3-to-sqs-test-bucket"
-+ //
-+ // String queueUrl = awsConnector.createQueue(queueName)
-+ // awsConnector.createBucket(bucketName)
-+ //
-+ // String queueArn = awsConnector.getQueueArn(queueUrl)
-+ // awsConnector.setQueuePublishingPolicy(queueUrl, queueArn)
-+ // awsConnector.enableS3ToSqsNotifications(bucketName, queueArn)
-+ //
-+ // when:
-+ // // test message, auto created by AWS
-+ // awsConnector.receiveMessage(queueUrl)
-+ // awsConnector.putSampleData(bucketName)
-+ // // traced message
-+ // def receiveMessageResult = awsConnector.receiveMessage(queueUrl)
-+ // receiveMessageResult.messages.each {message ->
-+ // runWithSpan("process child") {}
-+ // }
-+ //
-+ // // cleanup
-+ // awsConnector.deleteBucket(bucketName)
-+ // awsConnector.purgeQueue(queueUrl)
-+ //
-+ // then:
-+ // assertTraces(10) {
-+ // trace(0, 1) {
-+ //
-+ // span(0) {
-+ // name "SQS.CreateQueue"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "CreateQueue"
-+ // "aws.queue.name" queueName
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "AmazonSQS"
-+ // "http.method" "POST"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // }
-+ // trace(1, 1) {
-+ //
-+ // span(0) {
-+ // name "S3.CreateBucket"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "CreateBucket"
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "Amazon S3"
-+ // "aws.bucket.name" bucketName
-+ // "http.method" "PUT"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // }
-+ // trace(2, 1) {
-+ //
-+ // span(0) {
-+ // name "SQS.GetQueueAttributes"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "GetQueueAttributes"
-+ // "aws.queue.url" queueUrl
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "AmazonSQS"
-+ // "http.method" "POST"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // }
-+ // trace(3, 1) {
-+ //
-+ // span(0) {
-+ // name "SQS.SetQueueAttributes"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "SetQueueAttributes"
-+ // "aws.queue.url" queueUrl
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "AmazonSQS"
-+ // "http.method" "POST"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // }
-+ // trace(4, 1) {
-+ //
-+ // span(0) {
-+ // name "S3.SetBucketNotificationConfiguration"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "SetBucketNotificationConfiguration"
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "Amazon S3"
-+ // "aws.bucket.name" bucketName
-+ // "http.method" "PUT"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // }
-+ // trace(5, 3) {
-+ // span(0) {
-+ // name "S3.PutObject"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "PutObject"
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "Amazon S3"
-+ // "aws.bucket.name" bucketName
-+ // "http.method" "PUT"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // span(1) {
-+ // name "s3ToSqsTestQueue process"
-+ // kind CONSUMER
-+ // childOf span(0)
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "ReceiveMessage"
-+ // "aws.queue.url" queueUrl
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "AmazonSQS"
-+ // "http.method" "POST"
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.MESSAGING_SYSTEM" "AmazonSQS"
-+ // "$SemanticAttributes.MESSAGING_DESTINATION_NAME" "s3ToSqsTestQueue"
-+ // "$SemanticAttributes.MESSAGING_OPERATION" "process"
-+ // "$SemanticAttributes.MESSAGING_MESSAGE_ID" String
-+ // }
-+ // }
-+ // span(2) {
-+ // name "process child"
-+ // childOf span(1)
-+ // attributes {
-+ // }
-+ // }
-+ // }
-+ // trace(6, 1) {
-+ // span(0) {
-+ // name "S3.ListObjects"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "ListObjects"
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "Amazon S3"
-+ // "aws.bucket.name" bucketName
-+ // "http.method" "GET"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // }
-+ // trace(7, 1) {
-+ // span(0) {
-+ // name "S3.DeleteObject"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "DeleteObject"
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "Amazon S3"
-+ // "aws.bucket.name" bucketName
-+ // "http.method" "DELETE"
-+ // "http.status_code" 204
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // }
-+ // trace(8, 1) {
-+ // span(0) {
-+ // name "S3.DeleteBucket"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "DeleteBucket"
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "Amazon S3"
-+ // "aws.bucket.name" bucketName
-+ // "http.method" "DELETE"
-+ // "http.status_code" 204
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // }
-+ // trace(9, 1) {
-+ // span(0) {
-+ // name "SQS.PurgeQueue"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "PurgeQueue"
-+ // "aws.queue.url" queueUrl
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "AmazonSQS"
-+ // "http.method" "POST"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // }
-+ // }
-+ //}
-
-- String queueUrl = awsConnector.createQueue(queueName)
-- awsConnector.createBucket(bucketName)
--
-- String queueArn = awsConnector.getQueueArn(queueUrl)
-- awsConnector.setQueuePublishingPolicy(queueUrl, queueArn)
-- awsConnector.enableS3ToSqsNotifications(bucketName, queueArn)
--
-- when:
-- // test message, auto created by AWS
-- awsConnector.receiveMessage(queueUrl)
-- awsConnector.putSampleData(bucketName)
-- // traced message
-- def receiveMessageResult = awsConnector.receiveMessage(queueUrl)
-- receiveMessageResult.messages.each {message ->
-- runWithSpan("process child") {}
-- }
--
-- // cleanup
-- awsConnector.deleteBucket(bucketName)
-- awsConnector.purgeQueue(queueUrl)
--
-- then:
-- assertTraces(10) {
-- trace(0, 1) {
--
-- span(0) {
-- name "SQS.CreateQueue"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "CreateQueue"
-- "aws.queue.name" queueName
-- "rpc.system" "aws-api"
-- "rpc.service" "AmazonSQS"
-- "http.method" "POST"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- }
-- trace(1, 1) {
--
-- span(0) {
-- name "S3.CreateBucket"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "CreateBucket"
-- "rpc.system" "aws-api"
-- "rpc.service" "Amazon S3"
-- "aws.bucket.name" bucketName
-- "http.method" "PUT"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- }
-- trace(2, 1) {
--
-- span(0) {
-- name "SQS.GetQueueAttributes"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "GetQueueAttributes"
-- "aws.queue.url" queueUrl
-- "rpc.system" "aws-api"
-- "rpc.service" "AmazonSQS"
-- "http.method" "POST"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- }
-- trace(3, 1) {
--
-- span(0) {
-- name "SQS.SetQueueAttributes"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "SetQueueAttributes"
-- "aws.queue.url" queueUrl
-- "rpc.system" "aws-api"
-- "rpc.service" "AmazonSQS"
-- "http.method" "POST"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- }
-- trace(4, 1) {
--
-- span(0) {
-- name "S3.SetBucketNotificationConfiguration"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "SetBucketNotificationConfiguration"
-- "rpc.system" "aws-api"
-- "rpc.service" "Amazon S3"
-- "aws.bucket.name" bucketName
-- "http.method" "PUT"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- }
-- trace(5, 3) {
-- span(0) {
-- name "S3.PutObject"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "PutObject"
-- "rpc.system" "aws-api"
-- "rpc.service" "Amazon S3"
-- "aws.bucket.name" bucketName
-- "http.method" "PUT"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- span(1) {
-- name "s3ToSqsTestQueue process"
-- kind CONSUMER
-- childOf span(0)
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "ReceiveMessage"
-- "aws.queue.url" queueUrl
-- "rpc.system" "aws-api"
-- "rpc.service" "AmazonSQS"
-- "http.method" "POST"
-- "http.url" String
-- "net.peer.name" String
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.MESSAGING_SYSTEM" "AmazonSQS"
-- "$SemanticAttributes.MESSAGING_DESTINATION_NAME" "s3ToSqsTestQueue"
-- "$SemanticAttributes.MESSAGING_OPERATION" "process"
-- "$SemanticAttributes.MESSAGING_MESSAGE_ID" String
-- }
-- }
-- span(2) {
-- name "process child"
-- childOf span(1)
-- attributes {
-- }
-- }
-- }
-- trace(6, 1) {
-- span(0) {
-- name "S3.ListObjects"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "ListObjects"
-- "rpc.system" "aws-api"
-- "rpc.service" "Amazon S3"
-- "aws.bucket.name" bucketName
-- "http.method" "GET"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- }
-- trace(7, 1) {
-- span(0) {
-- name "S3.DeleteObject"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "DeleteObject"
-- "rpc.system" "aws-api"
-- "rpc.service" "Amazon S3"
-- "aws.bucket.name" bucketName
-- "http.method" "DELETE"
-- "http.status_code" 204
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- }
-- trace(8, 1) {
-- span(0) {
-- name "S3.DeleteBucket"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "DeleteBucket"
-- "rpc.system" "aws-api"
-- "rpc.service" "Amazon S3"
-- "aws.bucket.name" bucketName
-- "http.method" "DELETE"
-- "http.status_code" 204
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- }
-- trace(9, 1) {
-- span(0) {
-- name "SQS.PurgeQueue"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "PurgeQueue"
-- "aws.queue.url" queueUrl
-- "rpc.system" "aws-api"
-- "rpc.service" "AmazonSQS"
-- "http.method" "POST"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- }
-- }
-- }
--
-- def "S3 upload triggers SNS topic notification, then creates SQS message"() {
-- setup:
-- String queueName = "s3ToSnsToSqsTestQueue"
-- String bucketName = "otel-s3-sns-sqs-test-bucket"
-- String topicName = "s3ToSnsToSqsTestTopic"
--
-- String queueUrl = awsConnector.createQueue(queueName)
-- String queueArn = awsConnector.getQueueArn(queueUrl)
-- awsConnector.createBucket(bucketName)
-- String topicArn = awsConnector.createTopicAndSubscribeQueue(topicName, queueArn)
--
-- awsConnector.setQueuePublishingPolicy(queueUrl, queueArn)
-- awsConnector.setTopicPublishingPolicy(topicArn)
-- awsConnector.enableS3ToSnsNotifications(bucketName, topicArn)
--
-- when:
-- // test message, auto created by AWS
-- awsConnector.receiveMessage(queueUrl)
-- awsConnector.putSampleData(bucketName)
-- // traced message
-- def receiveMessageResult = awsConnector.receiveMessage(queueUrl)
-- receiveMessageResult.messages.each {message ->
-- runWithSpan("process child") {}
-- }
-- // cleanup
-- awsConnector.deleteBucket(bucketName)
-- awsConnector.purgeQueue(queueUrl)
--
-- then:
-- assertTraces(14) {
-- trace(0, 1) {
-- span(0) {
-- name "SQS.CreateQueue"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "CreateQueue"
-- "aws.queue.name" queueName
-- "rpc.system" "aws-api"
-- "rpc.service" "AmazonSQS"
-- "http.method" "POST"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- }
-- trace(1, 1) {
-- span(0) {
-- name "SQS.GetQueueAttributes"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "GetQueueAttributes"
-- "aws.queue.url" queueUrl
-- "rpc.system" "aws-api"
-- "rpc.service" "AmazonSQS"
-- "http.method" "POST"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- }
-- trace(2, 1) {
-- span(0) {
-- name "S3.CreateBucket"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "CreateBucket"
-- "rpc.system" "aws-api"
-- "rpc.service" "Amazon S3"
-- "aws.bucket.name" bucketName
-- "http.method" "PUT"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- }
-- trace(3, 1) {
-- span(0) {
-- name "SNS.CreateTopic"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "CreateTopic"
-- "rpc.system" "aws-api"
-- "rpc.service" "AmazonSNS"
-- "http.method" "POST"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- }
-- trace(4, 1) {
-- span(0) {
-- name "SNS.Subscribe"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "Subscribe"
-- "rpc.system" "aws-api"
-- "rpc.service" "AmazonSNS"
-- "http.method" "POST"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- }
-- trace(5, 1) {
-- span(0) {
-- name "SQS.SetQueueAttributes"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "SetQueueAttributes"
-- "aws.queue.url" queueUrl
-- "rpc.system" "aws-api"
-- "rpc.service" "AmazonSQS"
-- "http.method" "POST"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- }
-- trace(6, 1) {
-- span(0) {
-- name "SNS.SetTopicAttributes"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "SetTopicAttributes"
-- "rpc.system" "aws-api"
-- "rpc.service" "AmazonSNS"
-- "http.method" "POST"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- }
-- trace(7, 1) {
-- span(0) {
-- name "S3.SetBucketNotificationConfiguration"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "SetBucketNotificationConfiguration"
-- "rpc.system" "aws-api"
-- "rpc.service" "Amazon S3"
-- "aws.bucket.name" bucketName
-- "http.method" "PUT"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- }
-- trace(8, 1) {
-- span(0) {
-- name "S3.PutObject"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "PutObject"
-- "rpc.system" "aws-api"
-- "rpc.service" "Amazon S3"
-- "aws.bucket.name" bucketName
-- "http.method" "PUT"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- }
-- trace(9, 2) {
-- span(0) {
-- name "s3ToSnsToSqsTestQueue process"
-- kind CONSUMER
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "ReceiveMessage"
-- "aws.queue.url" queueUrl
-- "rpc.system" "aws-api"
-- "rpc.service" "AmazonSQS"
-- "http.method" "POST"
-- "http.url" String
-- "net.peer.name" String
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.MESSAGING_SYSTEM" "AmazonSQS"
-- "$SemanticAttributes.MESSAGING_DESTINATION_NAME" "s3ToSnsToSqsTestQueue"
-- "$SemanticAttributes.MESSAGING_OPERATION" "process"
-- "$SemanticAttributes.MESSAGING_MESSAGE_ID" String
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- span(1) {
-- name "process child"
-- childOf span(0)
-- attributes {
-- }
-- }
-- }
-- trace(10, 1) {
-- span(0) {
-- name "S3.ListObjects"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "ListObjects"
-- "rpc.system" "aws-api"
-- "rpc.service" "Amazon S3"
-- "aws.bucket.name" bucketName
-- "http.method" "GET"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- }
-- trace(11, 1) {
-- span(0) {
-- name "S3.DeleteObject"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "DeleteObject"
-- "rpc.system" "aws-api"
-- "rpc.service" "Amazon S3"
-- "aws.bucket.name" bucketName
-- "http.method" "DELETE"
-- "http.status_code" 204
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- }
-- trace(12, 1) {
-- span(0) {
-- name "S3.DeleteBucket"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "DeleteBucket"
-- "rpc.system" "aws-api"
-- "rpc.service" "Amazon S3"
-- "aws.bucket.name" bucketName
-- "http.method" "DELETE"
-- "http.status_code" 204
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- }
-- trace(13, 1) {
-- span(0) {
-- name "SQS.PurgeQueue"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "PurgeQueue"
-- "aws.queue.url" queueUrl
-- "rpc.system" "aws-api"
-- "rpc.service" "AmazonSQS"
-- "http.method" "POST"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-- }
-- }
-- }
-- }
-- }
-+ //def "S3 upload triggers SNS topic notification, then creates SQS message"() {
-+ // setup:
-+ // String queueName = "s3ToSnsToSqsTestQueue"
-+ // String bucketName = "otel-s3-sns-sqs-test-bucket"
-+ // String topicName = "s3ToSnsToSqsTestTopic"
-+ //
-+ // String queueUrl = awsConnector.createQueue(queueName)
-+ // String queueArn = awsConnector.getQueueArn(queueUrl)
-+ // awsConnector.createBucket(bucketName)
-+ // String topicArn = awsConnector.createTopicAndSubscribeQueue(topicName, queueArn)
-+ //
-+ // awsConnector.setQueuePublishingPolicy(queueUrl, queueArn)
-+ // awsConnector.setTopicPublishingPolicy(topicArn)
-+ // awsConnector.enableS3ToSnsNotifications(bucketName, topicArn)
-+ //
-+ // when:
-+ // // test message, auto created by AWS
-+ // awsConnector.receiveMessage(queueUrl)
-+ // awsConnector.putSampleData(bucketName)
-+ // // traced message
-+ // def receiveMessageResult = awsConnector.receiveMessage(queueUrl)
-+ // receiveMessageResult.messages.each {message ->
-+ // runWithSpan("process child") {}
-+ // }
-+ // // cleanup
-+ // awsConnector.deleteBucket(bucketName)
-+ // awsConnector.purgeQueue(queueUrl)
-+ //
-+ // then:
-+ // assertTraces(14) {
-+ // trace(0, 1) {
-+ // span(0) {
-+ // name "SQS.CreateQueue"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "CreateQueue"
-+ // "aws.queue.name" queueName
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "AmazonSQS"
-+ // "http.method" "POST"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // }
-+ // trace(1, 1) {
-+ // span(0) {
-+ // name "SQS.GetQueueAttributes"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "GetQueueAttributes"
-+ // "aws.queue.url" queueUrl
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "AmazonSQS"
-+ // "http.method" "POST"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // }
-+ // trace(2, 1) {
-+ // span(0) {
-+ // name "S3.CreateBucket"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "CreateBucket"
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "Amazon S3"
-+ // "aws.bucket.name" bucketName
-+ // "http.method" "PUT"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // }
-+ // trace(3, 1) {
-+ // span(0) {
-+ // name "SNS.CreateTopic"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "CreateTopic"
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "AmazonSNS"
-+ // "http.method" "POST"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // }
-+ // trace(4, 1) {
-+ // span(0) {
-+ // name "SNS.Subscribe"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "Subscribe"
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "AmazonSNS"
-+ // "http.method" "POST"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // }
-+ // trace(5, 1) {
-+ // span(0) {
-+ // name "SQS.SetQueueAttributes"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "SetQueueAttributes"
-+ // "aws.queue.url" queueUrl
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "AmazonSQS"
-+ // "http.method" "POST"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // }
-+ // trace(6, 1) {
-+ // span(0) {
-+ // name "SNS.SetTopicAttributes"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "SetTopicAttributes"
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "AmazonSNS"
-+ // "http.method" "POST"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // }
-+ // trace(7, 1) {
-+ // span(0) {
-+ // name "S3.SetBucketNotificationConfiguration"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "SetBucketNotificationConfiguration"
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "Amazon S3"
-+ // "aws.bucket.name" bucketName
-+ // "http.method" "PUT"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // }
-+ // trace(8, 1) {
-+ // span(0) {
-+ // name "S3.PutObject"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "PutObject"
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "Amazon S3"
-+ // "aws.bucket.name" bucketName
-+ // "http.method" "PUT"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // }
-+ // trace(9, 2) {
-+ // span(0) {
-+ // name "s3ToSnsToSqsTestQueue process"
-+ // kind CONSUMER
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "ReceiveMessage"
-+ // "aws.queue.url" queueUrl
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "AmazonSQS"
-+ // "http.method" "POST"
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.MESSAGING_SYSTEM" "AmazonSQS"
-+ // "$SemanticAttributes.MESSAGING_DESTINATION_NAME" "s3ToSnsToSqsTestQueue"
-+ // "$SemanticAttributes.MESSAGING_OPERATION" "process"
-+ // "$SemanticAttributes.MESSAGING_MESSAGE_ID" String
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // span(1) {
-+ // name "process child"
-+ // childOf span(0)
-+ // attributes {
-+ // }
-+ // }
-+ // }
-+ // trace(10, 1) {
-+ // span(0) {
-+ // name "S3.ListObjects"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "ListObjects"
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "Amazon S3"
-+ // "aws.bucket.name" bucketName
-+ // "http.method" "GET"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // }
-+ // trace(11, 1) {
-+ // span(0) {
-+ // name "S3.DeleteObject"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "DeleteObject"
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "Amazon S3"
-+ // "aws.bucket.name" bucketName
-+ // "http.method" "DELETE"
-+ // "http.status_code" 204
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // }
-+ // trace(12, 1) {
-+ // span(0) {
-+ // name "S3.DeleteBucket"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "DeleteBucket"
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "Amazon S3"
-+ // "aws.bucket.name" bucketName
-+ // "http.method" "DELETE"
-+ // "http.status_code" 204
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // }
-+ // trace(13, 1) {
-+ // span(0) {
-+ // name "SQS.PurgeQueue"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "PurgeQueue"
-+ // "aws.queue.url" queueUrl
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "AmazonSQS"
-+ // "http.method" "POST"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
-+ // }
-+ // }
-+ // }
-+ // }
-+ //}
- }
+@@ -444,6 +444,7 @@ class S3TracingTest extends AgentInstrumentationSpecification {
+ "net.peer.port" { it == null || Number }
+ "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
+ "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
++ "aws.sns.topic.arn" "$topicArn"
+ }
+ }
+ }
+@@ -467,6 +468,7 @@ class S3TracingTest extends AgentInstrumentationSpecification {
+ "net.peer.port" { it == null || Number }
+ "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
+ "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
++ "aws.sns.topic.arn" "$topicArn"
+ }
+ }
+ }
+@@ -514,6 +516,7 @@ class S3TracingTest extends AgentInstrumentationSpecification {
+ "net.peer.port" { it == null || Number }
+ "$SemanticAttributes.HTTP_REQUEST_CONTENT_LENGTH" { it == null || it instanceof Long }
+ "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" { it == null || it instanceof Long }
++ "aws.sns.topic.arn" "$topicArn"
+ }
+ }
+ }
diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/test/groovy/SnsTracingTest.groovy b/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/test/groovy/SnsTracingTest.groovy
-index 97749cf085..f7402c1e4b 100644
+index 97749cf085..a0b83ca870 100644
--- a/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/test/groovy/SnsTracingTest.groovy
+++ b/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/test/groovy/SnsTracingTest.groovy
-@@ -20,192 +20,192 @@ class SnsTracingTest extends AgentInstrumentationSpecification {
- awsConnector.disconnect()
- }
-
-- def "SNS notification triggers SQS message consumed with AWS SDK"() {
-- setup:
-- String queueName = "snsToSqsTestQueue"
-- String topicName = "snsToSqsTestTopic"
--
-- String queueUrl = awsConnector.createQueue(queueName)
-- String queueArn = awsConnector.getQueueArn(queueUrl)
-- awsConnector.setQueuePublishingPolicy(queueUrl, queueArn)
-- String topicArn = awsConnector.createTopicAndSubscribeQueue(topicName, queueArn)
--
-- when:
-- awsConnector.publishSampleNotification(topicArn)
-- def receiveMessageResult = awsConnector.receiveMessage(queueUrl)
-- receiveMessageResult.messages.each {message ->
-- runWithSpan("process child") {}
-- }
--
-- then:
-- assertTraces(6) {
-- trace(0, 1) {
--
-- span(0) {
-- name "SQS.CreateQueue"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "CreateQueue"
-- "aws.queue.name" queueName
-- "rpc.system" "aws-api"
-- "rpc.service" "AmazonSQS"
-- "http.method" "POST"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" Long
-- }
-- }
-- }
-- trace(1, 1) {
--
-- span(0) {
-- name "SQS.GetQueueAttributes"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "GetQueueAttributes"
-- "aws.queue.url" queueUrl
-- "rpc.system" "aws-api"
-- "rpc.service" "AmazonSQS"
-- "http.method" "POST"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" Long
-- }
-- }
-- }
-- trace(2, 1) {
--
-- span(0) {
-- name "SQS.SetQueueAttributes"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "SetQueueAttributes"
-- "aws.queue.url" queueUrl
-- "rpc.system" "aws-api"
-- "rpc.service" "AmazonSQS"
-- "http.method" "POST"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" Long
-- }
-- }
-- }
-- trace(3, 1) {
--
-- span(0) {
-- name "SNS.CreateTopic"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "CreateTopic"
-- "rpc.system" "aws-api"
-- "rpc.service" "AmazonSNS"
-- "http.method" "POST"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" Long
-- }
-- }
-- }
-- trace(4, 1) {
--
-- span(0) {
-- name "SNS.Subscribe"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "Subscribe"
-- "rpc.system" "aws-api"
-- "rpc.service" "AmazonSNS"
-- "http.method" "POST"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" Long
-- }
-- }
-- }
-- trace(5, 3) {
-- span(0) {
-- name "SNS.Publish"
-- kind CLIENT
-- hasNoParent()
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "rpc.method" "Publish"
-- "rpc.system" "aws-api"
-- "rpc.service" "AmazonSNS"
-- "http.method" "POST"
-- "http.status_code" 200
-- "http.url" String
-- "net.peer.name" String
-- "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-- "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" Long
-- }
-- }
-- span(1) {
-- name "snsToSqsTestQueue process"
-- kind CONSUMER
-- childOf span(0)
-- attributes {
-- "aws.agent" "java-aws-sdk"
-- "aws.endpoint" String
-- "aws.queue.url" queueUrl
-- "rpc.system" "aws-api"
-- "rpc.service" "AmazonSQS"
-- "rpc.method" "ReceiveMessage"
-- "http.method" "POST"
-- "http.url" String
-- "net.peer.name" String
-- "net.peer.port" { it == null || Number }
-- "$SemanticAttributes.MESSAGING_SYSTEM" "AmazonSQS"
-- "$SemanticAttributes.MESSAGING_DESTINATION_NAME" "snsToSqsTestQueue"
-- "$SemanticAttributes.MESSAGING_OPERATION" "process"
-- "$SemanticAttributes.MESSAGING_MESSAGE_ID" String
-- }
-- }
-- span(2) {
-- name "process child"
-- childOf span(1)
-- attributes {
-- }
-- }
-- }
-- }
-- }
-+ //def "SNS notification triggers SQS message consumed with AWS SDK"() {
-+ // setup:
-+ // String queueName = "snsToSqsTestQueue"
-+ // String topicName = "snsToSqsTestTopic"
-+ //
-+ // String queueUrl = awsConnector.createQueue(queueName)
-+ // String queueArn = awsConnector.getQueueArn(queueUrl)
-+ // awsConnector.setQueuePublishingPolicy(queueUrl, queueArn)
-+ // String topicArn = awsConnector.createTopicAndSubscribeQueue(topicName, queueArn)
-+ //
-+ // when:
-+ // awsConnector.publishSampleNotification(topicArn)
-+ // def receiveMessageResult = awsConnector.receiveMessage(queueUrl)
-+ // receiveMessageResult.messages.each {message ->
-+ // runWithSpan("process child") {}
-+ // }
-+ //
-+ // then:
-+ // assertTraces(6) {
-+ // trace(0, 1) {
-+ //
-+ // span(0) {
-+ // name "SQS.CreateQueue"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "CreateQueue"
-+ // "aws.queue.name" queueName
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "AmazonSQS"
-+ // "http.method" "POST"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" Long
-+ // }
-+ // }
-+ // }
-+ // trace(1, 1) {
-+ //
-+ // span(0) {
-+ // name "SQS.GetQueueAttributes"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "GetQueueAttributes"
-+ // "aws.queue.url" queueUrl
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "AmazonSQS"
-+ // "http.method" "POST"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" Long
-+ // }
-+ // }
-+ // }
-+ // trace(2, 1) {
-+ //
-+ // span(0) {
-+ // name "SQS.SetQueueAttributes"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "SetQueueAttributes"
-+ // "aws.queue.url" queueUrl
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "AmazonSQS"
-+ // "http.method" "POST"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" Long
-+ // }
-+ // }
-+ // }
-+ // trace(3, 1) {
-+ //
-+ // span(0) {
-+ // name "SNS.CreateTopic"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "CreateTopic"
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "AmazonSNS"
-+ // "http.method" "POST"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" Long
-+ // }
-+ // }
-+ // }
-+ // trace(4, 1) {
-+ //
-+ // span(0) {
-+ // name "SNS.Subscribe"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "Subscribe"
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "AmazonSNS"
-+ // "http.method" "POST"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" Long
-+ // }
-+ // }
-+ // }
-+ // trace(5, 3) {
-+ // span(0) {
-+ // name "SNS.Publish"
-+ // kind CLIENT
-+ // hasNoParent()
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "rpc.method" "Publish"
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "AmazonSNS"
-+ // "http.method" "POST"
-+ // "http.status_code" 200
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "$SemanticAttributes.NET_PROTOCOL_NAME" "http"
-+ // "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" Long
-+ // }
-+ // }
-+ // span(1) {
-+ // name "snsToSqsTestQueue process"
-+ // kind CONSUMER
-+ // childOf span(0)
-+ // attributes {
-+ // "aws.agent" "java-aws-sdk"
-+ // "aws.endpoint" String
-+ // "aws.queue.url" queueUrl
-+ // "rpc.system" "aws-api"
-+ // "rpc.service" "AmazonSQS"
-+ // "rpc.method" "ReceiveMessage"
-+ // "http.method" "POST"
-+ // "http.url" String
-+ // "net.peer.name" String
-+ // "net.peer.port" { it == null || Number }
-+ // "$SemanticAttributes.MESSAGING_SYSTEM" "AmazonSQS"
-+ // "$SemanticAttributes.MESSAGING_DESTINATION_NAME" "snsToSqsTestQueue"
-+ // "$SemanticAttributes.MESSAGING_OPERATION" "process"
-+ // "$SemanticAttributes.MESSAGING_MESSAGE_ID" String
-+ // }
-+ // }
-+ // span(2) {
-+ // name "process child"
-+ // childOf span(1)
-+ // attributes {
-+ // }
-+ // }
-+ // }
-+ // }
-+ //}
- }
-diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/test_before_1_11_106/groovy/Aws0ClientTest.groovy b/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/test_before_1_11_106/groovy/Aws0ClientTest.groovy
-index 543b6e8e8e..e4703eac17 100644
---- a/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/test_before_1_11_106/groovy/Aws0ClientTest.groovy
-+++ b/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/src/test_before_1_11_106/groovy/Aws0ClientTest.groovy
-@@ -133,8 +133,8 @@ class Aws0ClientTest extends AgentInstrumentationSpecification {
-
- where:
- service | operation | method | path | handlerCount | client | additionalAttributes | call | body
-- "S3" | "CreateBucket" | "PUT" | "/testbucket/" | 1 | new AmazonS3Client().withEndpoint("${server.httpUri()}") | ["aws.bucket.name": "testbucket"] | { c -> c.setS3ClientOptions(S3ClientOptions.builder().setPathStyleAccess(true).build()); c.createBucket("testbucket") } | ""
-- "S3" | "GetObject" | "GET" | "/someBucket/someKey" | 1 | new AmazonS3Client().withEndpoint("${server.httpUri()}") | ["aws.bucket.name": "someBucket"] | { c -> c.getObject("someBucket", "someKey") } | ""
-+ //"S3" | "CreateBucket" | "PUT" | "/testbucket/" | 1 | new AmazonS3Client().withEndpoint("${server.httpUri()}") | ["aws.bucket.name": "testbucket"] | { c -> c.setS3ClientOptions(S3ClientOptions.builder().setPathStyleAccess(true).build()); c.createBucket("testbucket") } | ""
-+ //"S3" | "GetObject" | "GET" | "/someBucket/someKey" | 1 | new AmazonS3Client().withEndpoint("${server.httpUri()}") | ["aws.bucket.name": "someBucket"] | { c -> c.getObject("someBucket", "someKey") } | ""
- "EC2" | "AllocateAddress" | "POST" | "/" | 4 | new AmazonEC2Client().withEndpoint("${server.httpUri()}") | [:] | { c -> c.allocateAddress() } | """
-
- 59dbff89-35bd-4eac-99ed-be587EXAMPLE
+@@ -131,6 +131,7 @@ class SnsTracingTest extends AgentInstrumentationSpecification {
+ "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
+ "net.peer.port" { it == null || Number }
+ "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" Long
++ "aws.sns.topic.arn" "$topicArn"
+ }
+ }
+ }
+@@ -154,6 +155,7 @@ class SnsTracingTest extends AgentInstrumentationSpecification {
+ "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
+ "net.peer.port" { it == null || Number }
+ "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" Long
++ "aws.sns.topic.arn" "$topicArn"
+ }
+ }
+ }
+@@ -176,6 +178,7 @@ class SnsTracingTest extends AgentInstrumentationSpecification {
+ "$SemanticAttributes.NET_PROTOCOL_VERSION" "1.1"
+ "net.peer.port" { it == null || Number }
+ "$SemanticAttributes.HTTP_RESPONSE_CONTENT_LENGTH" Long
++ "aws.sns.topic.arn" "$topicArn"
+ }
+ }
+ span(1) {
diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/library-autoconfigure/build.gradle.kts b/instrumentation/aws-sdk/aws-sdk-1.11/library-autoconfigure/build.gradle.kts
-index 6cf49a21c4..d2f9267072 100644
+index 6cf49a21c4..3705634153 100644
--- a/instrumentation/aws-sdk/aws-sdk-1.11/library-autoconfigure/build.gradle.kts
+++ b/instrumentation/aws-sdk/aws-sdk-1.11/library-autoconfigure/build.gradle.kts
@@ -18,6 +18,13 @@ dependencies {
@@ -1784,7 +82,7 @@ index 6cf49a21c4..d2f9267072 100644
testLibrary("com.amazonaws:aws-java-sdk-sns:1.11.106")
testLibrary("com.amazonaws:aws-java-sdk-sqs:1.11.106")
+ testLibrary("com.amazonaws:aws-java-sdk-secretsmanager:1.11.309")
-+ // testLibrary("com.amazonaws:aws-java-sdk-stepfunctions:1.11.230")
++ testLibrary("com.amazonaws:aws-java-sdk-stepfunctions:1.11.230")
+ testLibrary("com.amazonaws:aws-java-sdk-lambda:1.11.678")
+ testLibrary("com.amazonaws:aws-java-sdk-bedrock:1.12.744")
+ testLibrary("com.amazonaws:aws-java-sdk-bedrockagent:1.12.744")
@@ -1794,7 +92,7 @@ index 6cf49a21c4..d2f9267072 100644
// last version that does not use json protocol
latestDepTestLibrary("com.amazonaws:aws-java-sdk-sqs:1.12.583")
diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/library/build.gradle.kts b/instrumentation/aws-sdk/aws-sdk-1.11/library/build.gradle.kts
-index bfe844e413..a2cedc9fa2 100644
+index bfe844e413..dec4935b55 100644
--- a/instrumentation/aws-sdk/aws-sdk-1.11/library/build.gradle.kts
+++ b/instrumentation/aws-sdk/aws-sdk-1.11/library/build.gradle.kts
@@ -17,6 +17,14 @@ dependencies {
@@ -1803,7 +101,7 @@ index bfe844e413..a2cedc9fa2 100644
testLibrary("com.amazonaws:aws-java-sdk-sns:1.11.106")
+ testLibrary("com.amazonaws:aws-java-sdk-sqs:1.11.106")
+ testLibrary("com.amazonaws:aws-java-sdk-secretsmanager:1.11.309")
-+ // testLibrary("com.amazonaws:aws-java-sdk-stepfunctions:1.11.230")
++ testLibrary("com.amazonaws:aws-java-sdk-stepfunctions:1.11.230")
+ testLibrary("com.amazonaws:aws-java-sdk-lambda:1.11.678")
+ testLibrary("com.amazonaws:aws-java-sdk-bedrock:1.12.744")
+ testLibrary("com.amazonaws:aws-java-sdk-bedrockagent:1.12.744")
@@ -1952,10 +250,10 @@ index 0000000000..e890cb3c0f
+ }
+}
diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsExperimentalAttributes.java b/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsExperimentalAttributes.java
-index 3e8fddec5c..70e8eeae7f 100644
+index 3e8fddec5c..8f86a67b39 100644
--- a/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsExperimentalAttributes.java
+++ b/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsExperimentalAttributes.java
-@@ -18,6 +18,32 @@ final class AwsExperimentalAttributes {
+@@ -18,6 +18,49 @@ final class AwsExperimentalAttributes {
static final AttributeKey AWS_STREAM_NAME = stringKey("aws.stream.name");
static final AttributeKey AWS_TABLE_NAME = stringKey("aws.table.name");
static final AttributeKey AWS_REQUEST_ID = stringKey("aws.requestId");
@@ -1971,6 +269,23 @@ index 3e8fddec5c..70e8eeae7f 100644
+ stringKey("gen_ai.request.model");
+ static final AttributeKey AWS_BEDROCK_SYSTEM = stringKey("gen_ai.system");
+
++ static final AttributeKey GEN_AI_REQUEST_MAX_TOKENS =
++ stringKey("gen_ai.request.max_tokens");
++
++ static final AttributeKey GEN_AI_REQUEST_TEMPERATURE =
++ stringKey("gen_ai.request.temperature");
++
++ static final AttributeKey GEN_AI_REQUEST_TOP_P = stringKey("gen_ai.request.top_p");
++
++ static final AttributeKey GEN_AI_RESPONSE_FINISH_REASONS =
++ stringKey("gen_ai.response.finish_reasons");
++
++ static final AttributeKey GEN_AI_USAGE_INPUT_TOKENS =
++ stringKey("gen_ai.usage.input_tokens");
++
++ static final AttributeKey GEN_AI_USAGE_OUTPUT_TOKENS =
++ stringKey("gen_ai.usage.output_tokens");
++
+ static final AttributeKey AWS_STATE_MACHINE_ARN =
+ stringKey("aws.stepfunctions.state_machine.arn");
+
@@ -1989,10 +304,10 @@ index 3e8fddec5c..70e8eeae7f 100644
private AwsExperimentalAttributes() {}
}
diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsSdkExperimentalAttributesExtractor.java b/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsSdkExperimentalAttributesExtractor.java
-index 245f09a5d8..157fd891c3 100644
+index 245f09a5d8..aef7936980 100644
--- a/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsSdkExperimentalAttributesExtractor.java
+++ b/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AwsSdkExperimentalAttributesExtractor.java
-@@ -6,11 +6,23 @@
+@@ -6,13 +6,31 @@
package io.opentelemetry.instrumentation.awssdk.v1_11;
import static io.opentelemetry.instrumentation.awssdk.v1_11.AwsExperimentalAttributes.AWS_AGENT;
@@ -2015,8 +330,16 @@ index 245f09a5d8..157fd891c3 100644
+import static io.opentelemetry.instrumentation.awssdk.v1_11.AwsExperimentalAttributes.AWS_STEP_FUNCTIONS_ACTIVITY_ARN;
import static io.opentelemetry.instrumentation.awssdk.v1_11.AwsExperimentalAttributes.AWS_STREAM_NAME;
import static io.opentelemetry.instrumentation.awssdk.v1_11.AwsExperimentalAttributes.AWS_TABLE_NAME;
++import static io.opentelemetry.instrumentation.awssdk.v1_11.AwsExperimentalAttributes.GEN_AI_REQUEST_MAX_TOKENS;
++import static io.opentelemetry.instrumentation.awssdk.v1_11.AwsExperimentalAttributes.GEN_AI_REQUEST_TEMPERATURE;
++import static io.opentelemetry.instrumentation.awssdk.v1_11.AwsExperimentalAttributes.GEN_AI_REQUEST_TOP_P;
++import static io.opentelemetry.instrumentation.awssdk.v1_11.AwsExperimentalAttributes.GEN_AI_RESPONSE_FINISH_REASONS;
++import static io.opentelemetry.instrumentation.awssdk.v1_11.AwsExperimentalAttributes.GEN_AI_USAGE_INPUT_TOKENS;
++import static io.opentelemetry.instrumentation.awssdk.v1_11.AwsExperimentalAttributes.GEN_AI_USAGE_OUTPUT_TOKENS;
-@@ -21,12 +33,17 @@ import io.opentelemetry.api.common.AttributeKey;
+ import com.amazonaws.AmazonWebServiceResponse;
+ import com.amazonaws.Request;
+@@ -21,12 +39,17 @@ import io.opentelemetry.api.common.AttributeKey;
import io.opentelemetry.api.common.AttributesBuilder;
import io.opentelemetry.context.Context;
import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor;
@@ -2034,7 +357,7 @@ index 245f09a5d8..157fd891c3 100644
@Override
public void onStart(AttributesBuilder attributes, Context parentContext, Request> request) {
-@@ -34,21 +51,30 @@ class AwsSdkExperimentalAttributesExtractor
+@@ -34,21 +57,30 @@ class AwsSdkExperimentalAttributesExtractor
attributes.put(AWS_ENDPOINT, request.getEndpoint().toString());
Object originalRequest = request.getOriginalRequest();
@@ -2079,7 +402,7 @@ index 245f09a5d8..157fd891c3 100644
}
}
-@@ -59,12 +85,117 @@ class AwsSdkExperimentalAttributesExtractor
+@@ -59,12 +91,136 @@ class AwsSdkExperimentalAttributesExtractor
Request> request,
@Nullable Response> response,
@Nullable Throwable error) {
@@ -2104,15 +427,15 @@ index 245f09a5d8..157fd891c3 100644
+ if (requestId != null) {
+ attributes.put(AWS_REQUEST_ID, requestId);
+ }
-+ }
+ }
+ // Get serviceName defined in the AWS Java SDK V1 Request class.
+ String serviceName = request.getServiceName();
+ // Extract response attributes for Bedrock services
+ if (awsResp != null && isBedrockService(serviceName)) {
+ bedrockOnEnd(attributes, awsResp, serviceName);
- }
- }
- }
++ }
++ }
++ }
+
+ private static void bedrockOnStart(
+ AttributesBuilder attributes,
@@ -2147,6 +470,14 @@ index 245f09a5d8..157fd891c3 100644
+ Function