Repository: open-telemetry/opentelemetry-go-contrib
Pull request #2879 (2022-10-22 08:26:01)

[otelaws] Add DynamoDB and SQS X-Ray specific attributes
The AWS SDK v2 instrumentation library `otelaws` does not set SQS specific operational attributes. The goal here is to capture the SQS queue URL making it available to the AWS X-Ray exporter (in the collector) in order to provide more detailed telemetry data to X-Ray. Based on the PR comments, I've updated this PR to only include messaging attributes from the semantic conventions and not the AWS X-Ray bespoke attributes. This change will ensure the attributes are captured for SQS operations and made available to the exporters. Separately, we will need to update the collector exporter to extract the specific semantic convention attributes during the mapping between OTel and X-Ray.

Below is an example trace from the AWS X-Ray console that demonstrates what is possible once DynamoDB table and SQS Queue URL information is captured and exported to X-Ray.

**Before:**
<img width="758" alt="image" src="https://user-images.githubusercontent.com/5758495/197328951-3862ff77-6eff-426d-917b-f86a657d7056.png">

**After:**
<img width="758" alt="image" src="https://user-images.githubusercontent.com/5758495/197328976-1b7808a1-846d-41b6-bed8-6dddf29d7e8a.png">




codecov[bot]: # [Codecov](https://codecov.io/gh/open-telemetry/opentelemetry-go-contrib/pull/2879?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) Report
> Merging [#2879](https://codecov.io/gh/open-telemetry/opentelemetry-go-contrib/pull/2879?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) (d10d4fd) into [main](https://codecov.io/gh/open-telemetry/opentelemetry-go-contrib/commit/7def0b37e573d3c659d4ef6202cae475f836eafa?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) (7def0b3) will **increase** coverage by `0.2%`.
> The diff coverage is `100.0%`.

<details><summary>Additional details and impacted files</summary>


[![Impacted file tree graph](https://codecov.io/gh/open-telemetry/opentelemetry-go-contrib/pull/2879/graphs/tree.svg?width=650&height=150&src=pr&token=P6F3W9WA7Q&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)](https://codecov.io/gh/open-telemetry/opentelemetry-go-contrib/pull/2879?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)

```diff
@@           Coverage Diff           @@
##            main   #2879     +/-   ##
=======================================
+ Coverage   69.3%   69.6%   +0.2%     
=======================================
  Files        145     146      +1     
  Lines       6729    6790     +61     
=======================================
+ Hits        4667    4728     +61     
  Misses      1948    1948             
  Partials     114     114             
```


| [Impacted Files](https://codecov.io/gh/open-telemetry/opentelemetry-go-contrib/pull/2879?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | Coverage Δ | |
|---|---|---|
| [...github.com/aws/aws-sdk-go-v2/otelaws/attributes.go](https://codecov.io/gh/open-telemetry/opentelemetry-go-contrib/pull/2879/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-aW5zdHJ1bWVudGF0aW9uL2dpdGh1Yi5jb20vYXdzL2F3cy1zZGstZ28tdjIvb3RlbGF3cy9hdHRyaWJ1dGVzLmdv) | `84.2% <100.0%> (+4.2%)` | :arrow_up: |
| [...om/aws/aws-sdk-go-v2/otelaws/dynamodbattributes.go](https://codecov.io/gh/open-telemetry/opentelemetry-go-contrib/pull/2879/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-aW5zdHJ1bWVudGF0aW9uL2dpdGh1Yi5jb20vYXdzL2F3cy1zZGstZ28tdjIvb3RlbGF3cy9keW5hbW9kYmF0dHJpYnV0ZXMuZ28=) | `100.0% <100.0%> (ø)` | |
| [...hub.com/aws/aws-sdk-go-v2/otelaws/sqsattributes.go](https://codecov.io/gh/open-telemetry/opentelemetry-go-contrib/pull/2879/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-aW5zdHJ1bWVudGF0aW9uL2dpdGh1Yi5jb20vYXdzL2F3cy1zZGstZ28tdjIvb3RlbGF3cy9zcXNhdHRyaWJ1dGVzLmdv) | `100.0% <100.0%> (ø)` | |

</details>

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 87140b977..4576559b9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
 
 ## [Unreleased]
 
+### Added
+
+- Add the `messaging.url` & `messaging.system` attributes to all appropriate SQS operations in the `go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws` package. (#2879)
+
 ## [1.11.1/0.36.4/0.5.2]
 
 ### Added
diff --git a/instrumentation/github.com/aws/aws-lambda-go/otellambda/example/go.mod b/instrumentation/github.com/aws/aws-lambda-go/otellambda/example/go.mod
index 8fad1fc6d..40272097e 100644
--- a/instrumentation/github.com/aws/aws-lambda-go/otellambda/example/go.mod
+++ b/instrumentation/github.com/aws/aws-lambda-go/otellambda/example/go.mod
@@ -37,6 +37,7 @@ require (
 	github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.19 // indirect
 	github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.19 // indirect
 	github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.19 // indirect
+	github.com/aws/aws-sdk-go-v2/service/sqs v1.19.10 // indirect
 	github.com/aws/aws-sdk-go-v2/service/sso v1.11.25 // indirect
 	github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.8 // indirect
 	github.com/aws/aws-sdk-go-v2/service/sts v1.17.1 // indirect
diff --git a/instrumentation/github.com/aws/aws-lambda-go/otellambda/example/go.sum b/instrumentation/github.com/aws/aws-lambda-go/otellambda/example/go.sum
index 37ffc22d0..8031cd495 100644
--- a/instrumentation/github.com/aws/aws-lambda-go/otellambda/example/go.sum
+++ b/instrumentation/github.com/aws/aws-lambda-go/otellambda/example/go.sum
@@ -1,5 +1,6 @@
 github.com/aws/aws-lambda-go v1.34.1 h1:M3a/uFYBjii+tDcOJ0wL/WyFi2550FHoECdPf27zvOs=
 github.com/aws/aws-lambda-go v1.34.1/go.mod h1:jwFe2KmMsHmffA1X2R09hH6lFzJQxzI8qK17ewzbQMM=
+github.com/aws/aws-sdk-go-v2 v1.16.16/go.mod h1:SwiyXi/1zTUZ6KIAmLK5V5ll8SiURNUYOqTerZPaF9k=
 github.com/aws/aws-sdk-go-v2 v1.17.1 h1:02c72fDJr87N8RAC2s3Qu0YuvMRZKNZJ9F+lAehCazk=
 github.com/aws/aws-sdk-go-v2 v1.17.1/go.mod h1:JLnGeGONAyi2lWXI1p0PCIOIy333JMVK1U7Hf0aRFLw=
 github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.9 h1:RKci2D7tMwpvGpDNZnGQw9wk6v7o/xSwFcUAuNPoB8k=
@@ -10,8 +11,10 @@ github.com/aws/aws-sdk-go-v2/credentials v1.12.23 h1:LctvcJMIb8pxvk5hQhChpCu0WlU
 github.com/aws/aws-sdk-go-v2/credentials v1.12.23/go.mod h1:0awX9iRr/+UO7OwRQFpV1hNtXxOVuehpjVEzrIAYNcA=
 github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.19 h1:E3PXZSI3F2bzyj6XxUXdTIfvp425HHhwKsFvmzBwHgs=
 github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.19/go.mod h1:VihW95zQpeKQWVPGkwT+2+WJNQV8UXFfMTWdU6VErL8=
+github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.23/go.mod h1:2DFxAQ9pfIRy0imBCJv+vZ2X6RKxves6fbnEuSry6b4=
 github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.25 h1:nBO/RFxeq/IS5G9Of+ZrgucRciie2qpLy++3UGZ+q2E=
 github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.25/go.mod h1:Zb29PYkf42vVYQY6pvSyJCJcFHlPIiY+YKdPtwnvMkY=
+github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.17/go.mod h1:pRwaTYCJemADaqCbUAxltMoHKata7hmB5PjEXeu0kfg=
 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.19 h1:oRHDrwCTVT8ZXi4sr9Ld+EXk7N/KGssOr2ygNeojEhw=
 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.19/go.mod h1:6Q0546uHDp421okhmmGfbxzq2hBqbXFNpi4k+Q1JnQA=
 github.com/aws/aws-sdk-go-v2/internal/ini v1.3.26 h1:Mza+vlnZr+fPKFKRq/lKGVvM6B/8ZZmNdEopOwSQLms=
@@ -32,12 +35,15 @@ github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.19 h1:piDBAaWkaxkkV
 github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.19/go.mod h1:BmQWRVkLTmyNzYPFAZgon53qKLWBNSvonugD1MrSWUs=
 github.com/aws/aws-sdk-go-v2/service/s3 v1.29.1 h1:/EMdFPW/Ppieh0WUtQf1+qCGNLdsq5UWUyevBQ6vMVc=
 github.com/aws/aws-sdk-go-v2/service/s3 v1.29.1/go.mod h1:/NHbqPRiwxSPVOB2Xr+StDEH+GWV/64WwnUjv4KYzV0=
+github.com/aws/aws-sdk-go-v2/service/sqs v1.19.10 h1:Y4civ9pg5cbQkSf/YGMfFZaIPAAAK61JV+NIzO8Ri4k=
+github.com/aws/aws-sdk-go-v2/service/sqs v1.19.10/go.mod h1:65Z/rmGw/6usiOFI0Tk4ddNUmPbjjPER1WLZwnFqxFM=
 github.com/aws/aws-sdk-go-v2/service/sso v1.11.25 h1:GFZitO48N/7EsFDt8fMa5iYdmWqkUDDB3Eje6z3kbG0=
 github.com/aws/aws-sdk-go-v2/service/sso v1.11.25/go.mod h1:IARHuzTXmj1C0KS35vboR0FeJ89OkEy1M9mWbK2ifCI=
 github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.8 h1:jcw6kKZrtNfBPJkaHrscDOZoe5gvi9wjudnxvozYFJo=
 github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.8/go.mod h1:er2JHN+kBY6FcMfcBBKNGCT3CarImmdFzishsqBmSRI=
 github.com/aws/aws-sdk-go-v2/service/sts v1.17.1 h1:KRAix/KHvjGODaHAMXnxRk9t0D+4IJVUuS/uwXxngXk=
 github.com/aws/aws-sdk-go-v2/service/sts v1.17.1/go.mod h1:bXcN3koeVYiJcdDU89n3kCYILob7Y34AeLopUbZgLT4=
+github.com/aws/smithy-go v1.13.3/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
 github.com/aws/smithy-go v1.13.4 h1:/RN2z1txIJWeXeOkzX+Hk/4Uuvv7dWtCjbmVJcrskyk=
 github.com/aws/smithy-go v1.13.4/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/attributes.go b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/attributes.go
index d389ca4ce..29dc8b4ca 100644
--- a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/attributes.go
+++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/attributes.go
@@ -17,9 +17,9 @@ package otelaws // import "go.opentelemetry.io/contrib/instrumentation/github.co
 import (
 	"context"
 
-	"github.com/aws/aws-sdk-go-v2/service/dynamodb"
-
 	v2Middleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
+	"github.com/aws/aws-sdk-go-v2/service/dynamodb"
+	"github.com/aws/aws-sdk-go-v2/service/sqs"
 	"github.com/aws/smithy-go/middleware"
 
 	"go.opentelemetry.io/otel/attribute"
@@ -35,6 +35,7 @@ const (
 
 var servicemap = map[string]AttributeSetter{
 	dynamodb.ServiceID: DynamoDBAttributeSetter,
+	sqs.ServiceID:      SQSAttributeSetter,
 }
 
 // OperationAttr returns the AWS operation attribute.
@@ -42,17 +43,17 @@ func OperationAttr(operation string) attribute.KeyValue {
 	return OperationKey.String(operation)
 }
 
-// OperationAttr returns the AWS region attribute.
+// RegionAttr returns the AWS region attribute.
 func RegionAttr(region string) attribute.KeyValue {
 	return RegionKey.String(region)
 }
 
-// OperationAttr returns the AWS service attribute.
+// ServiceAttr returns the AWS service attribute.
 func ServiceAttr(service string) attribute.KeyValue {
 	return ServiceKey.String(service)
 }
 
-// OperationAttr returns the AWS request ID attribute.
+// RequestIDAttr returns the AWS request ID attribute.
 func RequestIDAttr(requestID string) attribute.KeyValue {
 	return RequestIDKey.String(requestID)
 }
diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/example/go.mod b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/example/go.mod
index 140c492e5..f026dc02d 100644
--- a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/example/go.mod
+++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/example/go.mod
@@ -29,6 +29,7 @@ require (
 	github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.19 // indirect
 	github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.19 // indirect
 	github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.19 // indirect
+	github.com/aws/aws-sdk-go-v2/service/sqs v1.19.10 // indirect
 	github.com/aws/aws-sdk-go-v2/service/sso v1.11.25 // indirect
 	github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.8 // indirect
 	github.com/aws/aws-sdk-go-v2/service/sts v1.17.1 // indirect
diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/example/go.sum b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/example/go.sum
index 5c572d7bd..82fe870d2 100644
--- a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/example/go.sum
+++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/example/go.sum
@@ -1,3 +1,4 @@
+github.com/aws/aws-sdk-go-v2 v1.16.16/go.mod h1:SwiyXi/1zTUZ6KIAmLK5V5ll8SiURNUYOqTerZPaF9k=
 github.com/aws/aws-sdk-go-v2 v1.17.1 h1:02c72fDJr87N8RAC2s3Qu0YuvMRZKNZJ9F+lAehCazk=
 github.com/aws/aws-sdk-go-v2 v1.17.1/go.mod h1:JLnGeGONAyi2lWXI1p0PCIOIy333JMVK1U7Hf0aRFLw=
 github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.9 h1:RKci2D7tMwpvGpDNZnGQw9wk6v7o/xSwFcUAuNPoB8k=
@@ -8,8 +9,10 @@ github.com/aws/aws-sdk-go-v2/credentials v1.12.23 h1:LctvcJMIb8pxvk5hQhChpCu0WlU
 github.com/aws/aws-sdk-go-v2/credentials v1.12.23/go.mod h1:0awX9iRr/+UO7OwRQFpV1hNtXxOVuehpjVEzrIAYNcA=
 github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.19 h1:E3PXZSI3F2bzyj6XxUXdTIfvp425HHhwKsFvmzBwHgs=
 github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.19/go.mod h1:VihW95zQpeKQWVPGkwT+2+WJNQV8UXFfMTWdU6VErL8=
+github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.23/go.mod h1:2DFxAQ9pfIRy0imBCJv+vZ2X6RKxves6fbnEuSry6b4=
 github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.25 h1:nBO/RFxeq/IS5G9Of+ZrgucRciie2qpLy++3UGZ+q2E=
 github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.25/go.mod h1:Zb29PYkf42vVYQY6pvSyJCJcFHlPIiY+YKdPtwnvMkY=
+github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.17/go.mod h1:pRwaTYCJemADaqCbUAxltMoHKata7hmB5PjEXeu0kfg=
 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.19 h1:oRHDrwCTVT8ZXi4sr9Ld+EXk7N/KGssOr2ygNeojEhw=
 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.19/go.mod h1:6Q0546uHDp421okhmmGfbxzq2hBqbXFNpi4k+Q1JnQA=
 github.com/aws/aws-sdk-go-v2/internal/ini v1.3.26 h1:Mza+vlnZr+fPKFKRq/lKGVvM6B/8ZZmNdEopOwSQLms=
@@ -30,12 +33,15 @@ github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.19 h1:piDBAaWkaxkkV
 github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.19/go.mod h1:BmQWRVkLTmyNzYPFAZgon53qKLWBNSvonugD1MrSWUs=
 github.com/aws/aws-sdk-go-v2/service/s3 v1.29.1 h1:/EMdFPW/Ppieh0WUtQf1+qCGNLdsq5UWUyevBQ6vMVc=
 github.com/aws/aws-sdk-go-v2/service/s3 v1.29.1/go.mod h1:/NHbqPRiwxSPVOB2Xr+StDEH+GWV/64WwnUjv4KYzV0=
+github.com/aws/aws-sdk-go-v2/service/sqs v1.19.10 h1:Y4civ9pg5cbQkSf/YGMfFZaIPAAAK61JV+NIzO8Ri4k=
+github.com/aws/aws-sdk-go-v2/service/sqs v1.19.10/go.mod h1:65Z/rmGw/6usiOFI0Tk4ddNUmPbjjPER1WLZwnFqxFM=
 github.com/aws/aws-sdk-go-v2/service/sso v1.11.25 h1:GFZitO48N/7EsFDt8fMa5iYdmWqkUDDB3Eje6z3kbG0=
 github.com/aws/aws-sdk-go-v2/service/sso v1.11.25/go.mod h1:IARHuzTXmj1C0KS35vboR0FeJ89OkEy1M9mWbK2ifCI=
 github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.8 h1:jcw6kKZrtNfBPJkaHrscDOZoe5gvi9wjudnxvozYFJo=
 github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.8/go.mod h1:er2JHN+kBY6FcMfcBBKNGCT3CarImmdFzishsqBmSRI=
 github.com/aws/aws-sdk-go-v2/service/sts v1.17.1 h1:KRAix/KHvjGODaHAMXnxRk9t0D+4IJVUuS/uwXxngXk=
 github.com/aws/aws-sdk-go-v2/service/sts v1.17.1/go.mod h1:bXcN3koeVYiJcdDU89n3kCYILob7Y34AeLopUbZgLT4=
+github.com/aws/smithy-go v1.13.3/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
 github.com/aws/smithy-go v1.13.4 h1:/RN2z1txIJWeXeOkzX+Hk/4Uuvv7dWtCjbmVJcrskyk=
 github.com/aws/smithy-go v1.13.4/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/go.mod b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/go.mod
index e8abcf548..e0c5b209c 100644
--- a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/go.mod
+++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/go.mod
@@ -5,6 +5,7 @@ go 1.18
 require (
 	github.com/aws/aws-sdk-go-v2 v1.17.1
 	github.com/aws/aws-sdk-go-v2/service/dynamodb v1.17.3
+	github.com/aws/aws-sdk-go-v2/service/sqs v1.19.10
 	github.com/aws/smithy-go v1.13.4
 	github.com/stretchr/testify v1.8.1
 	go.opentelemetry.io/otel v1.11.1
diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/go.sum b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/go.sum
index f170ece24..f4f0fcb6e 100644
--- a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/go.sum
+++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/go.sum
@@ -1,7 +1,10 @@
+github.com/aws/aws-sdk-go-v2 v1.16.16/go.mod h1:SwiyXi/1zTUZ6KIAmLK5V5ll8SiURNUYOqTerZPaF9k=
 github.com/aws/aws-sdk-go-v2 v1.17.1 h1:02c72fDJr87N8RAC2s3Qu0YuvMRZKNZJ9F+lAehCazk=
 github.com/aws/aws-sdk-go-v2 v1.17.1/go.mod h1:JLnGeGONAyi2lWXI1p0PCIOIy333JMVK1U7Hf0aRFLw=
+github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.23/go.mod h1:2DFxAQ9pfIRy0imBCJv+vZ2X6RKxves6fbnEuSry6b4=
 github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.25 h1:nBO/RFxeq/IS5G9Of+ZrgucRciie2qpLy++3UGZ+q2E=
 github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.25/go.mod h1:Zb29PYkf42vVYQY6pvSyJCJcFHlPIiY+YKdPtwnvMkY=
+github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.17/go.mod h1:pRwaTYCJemADaqCbUAxltMoHKata7hmB5PjEXeu0kfg=
 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.19 h1:oRHDrwCTVT8ZXi4sr9Ld+EXk7N/KGssOr2ygNeojEhw=
 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.19/go.mod h1:6Q0546uHDp421okhmmGfbxzq2hBqbXFNpi4k+Q1JnQA=
 github.com/aws/aws-sdk-go-v2/service/dynamodb v1.17.3 h1:2oB4ikNEMLaPtu6lbNFJyTSayBILvrOfa2VfOffcuvU=
@@ -10,6 +13,9 @@ github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.10 h1:dpiPHgm
 github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.10/go.mod h1:9cBNUHI2aW4ho0A5T87O294iPDuuUOSIEDjnd1Lq/z0=
 github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.19 h1:V03dAtcAN4Qtly7H3/0B6m3t/cyl4FgyKFqK738fyJw=
 github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.19/go.mod h1:2WpVWFC5n4DYhjNXzObtge8xfgId9UP6GWca46KJFLo=
+github.com/aws/aws-sdk-go-v2/service/sqs v1.19.10 h1:Y4civ9pg5cbQkSf/YGMfFZaIPAAAK61JV+NIzO8Ri4k=
+github.com/aws/aws-sdk-go-v2/service/sqs v1.19.10/go.mod h1:65Z/rmGw/6usiOFI0Tk4ddNUmPbjjPER1WLZwnFqxFM=
+github.com/aws/smithy-go v1.13.3/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
 github.com/aws/smithy-go v1.13.4 h1:/RN2z1txIJWeXeOkzX+Hk/4Uuvv7dWtCjbmVJcrskyk=
 github.com/aws/smithy-go v1.13.4/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/sqsattributes.go b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/sqsattributes.go
new file mode 100644
index 000000000..91b82bd7a
--- /dev/null
+++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/sqsattributes.go
@@ -0,0 +1,63 @@
+// Copyright The OpenTelemetry Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package otelaws // import "go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws"
+
+import (
+	"context"
+
+	"github.com/aws/aws-sdk-go-v2/service/sqs"
+	"github.com/aws/smithy-go/middleware"
+
+	"go.opentelemetry.io/otel/attribute"
+	semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
+)
+
+// SQSAttributeSetter sets SQS specific attributes depending on the SQS operation being performed.
+func SQSAttributeSetter(ctx context.Context, in middleware.InitializeInput) []attribute.KeyValue {
+	sqsAttributes := []attribute.KeyValue{semconv.MessagingSystemKey.String("AmazonSQS")}
+
+	switch v := in.Parameters.(type) {
+	case *sqs.DeleteMessageBatchInput:
+		sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl))
+	case *sqs.DeleteMessageInput:
+		sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl))
+	case *sqs.DeleteQueueInput:
+		sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl))
+	case *sqs.GetQueueAttributesInput:
+		sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl))
+	case *sqs.ListDeadLetterSourceQueuesInput:
+		sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl))
+	case *sqs.ListQueueTagsInput:
+		sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl))
+	case *sqs.PurgeQueueInput:
+		sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl))
+	case *sqs.ReceiveMessageInput:
+		sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl))
+	case *sqs.RemovePermissionInput:
+		sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl))
+	case *sqs.SendMessageBatchInput:
+		sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl))
+	case *sqs.SendMessageInput:
+		sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl))
+	case *sqs.SetQueueAttributesInput:
+		sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl))
+	case *sqs.TagQueueInput:
+		sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl))
+	case *sqs.UntagQueueInput:
+		sqsAttributes = append(sqsAttributes, semconv.MessagingURLKey.String(*v.QueueUrl))
+	}
+
+	return sqsAttributes
+}


Test patch:
diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/attributes_test.go b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/attributes_test.go
new file mode 100644
index 000000000..8696583d8
--- /dev/null
+++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/attributes_test.go
@@ -0,0 +1,47 @@
+// Copyright The OpenTelemetry Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package otelaws
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+
+	"go.opentelemetry.io/otel/attribute"
+)
+
+func TestOperationAttr(t *testing.T) {
+	operation := "test-operation"
+	attr := OperationAttr(operation)
+	assert.Equal(t, attribute.String("aws.operation", operation), attr)
+}
+
+func TestRegionAttr(t *testing.T) {
+	region := "test-region"
+	attr := RegionAttr(region)
+	assert.Equal(t, attribute.String("aws.region", region), attr)
+}
+
+func TestServiceAttr(t *testing.T) {
+	service := "test-service"
+	attr := ServiceAttr(service)
+	assert.Equal(t, attribute.String("aws.service", service), attr)
+}
+
+func TestRequestIDAttr(t *testing.T) {
+	requestID := "test-request-id"
+	attr := RequestIDAttr(requestID)
+	assert.Equal(t, attribute.String("aws.request_id", requestID), attr)
+}
diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/sqsattributes_test.go b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/sqsattributes_test.go
new file mode 100644
index 000000000..cb2115b0e
--- /dev/null
+++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/sqsattributes_test.go
@@ -0,0 +1,195 @@
+// Copyright The OpenTelemetry Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package otelaws
+
+import (
+	"context"
+	"testing"
+
+	"github.com/aws/aws-sdk-go-v2/aws"
+	"github.com/aws/aws-sdk-go-v2/service/sqs"
+	"github.com/aws/smithy-go/middleware"
+	"github.com/stretchr/testify/assert"
+
+	semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
+)
+
+func TestSQSDeleteMessageBatchInput(t *testing.T) {
+	input := middleware.InitializeInput{
+		Parameters: &sqs.DeleteMessageBatchInput{
+			QueueUrl: aws.String("test-queue-url"),
+		},
+	}
+
+	attributes := SQSAttributeSetter(context.TODO(), input)
+
+	assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url"))
+}
+
+func TestSQSDeleteMessageInput(t *testing.T) {
+	input := middleware.InitializeInput{
+		Parameters: &sqs.DeleteMessageInput{
+			QueueUrl: aws.String("test-queue-url"),
+		},
+	}
+
+	attributes := SQSAttributeSetter(context.TODO(), input)
+
+	assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url"))
+}
+
+func TestSQSDeleteQueueInput(t *testing.T) {
+	input := middleware.InitializeInput{
+		Parameters: &sqs.DeleteQueueInput{
+			QueueUrl: aws.String("test-queue-url"),
+		},
+	}
+
+	attributes := SQSAttributeSetter(context.TODO(), input)
+
+	assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url"))
+}
+
+func TestSQSGetQueueAttributesInput(t *testing.T) {
+	input := middleware.InitializeInput{
+		Parameters: &sqs.GetQueueAttributesInput{
+			QueueUrl: aws.String("test-queue-url"),
+		},
+	}
+
+	attributes := SQSAttributeSetter(context.TODO(), input)
+
+	assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url"))
+}
+
+func TestSQSListDeadLetterSourceQueuesInput(t *testing.T) {
+	input := middleware.InitializeInput{
+		Parameters: &sqs.ListDeadLetterSourceQueuesInput{
+			QueueUrl: aws.String("test-queue-url"),
+		},
+	}
+
+	attributes := SQSAttributeSetter(context.TODO(), input)
+
+	assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url"))
+}
+
+func TestSQSListQueueTagsInput(t *testing.T) {
+	input := middleware.InitializeInput{
+		Parameters: &sqs.ListQueueTagsInput{
+			QueueUrl: aws.String("test-queue-url"),
+		},
+	}
+
+	attributes := SQSAttributeSetter(context.TODO(), input)
+
+	assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url"))
+}
+
+func TestSQSPurgeQueueInput(t *testing.T) {
+	input := middleware.InitializeInput{
+		Parameters: &sqs.PurgeQueueInput{
+			QueueUrl: aws.String("test-queue-url"),
+		},
+	}
+
+	attributes := SQSAttributeSetter(context.TODO(), input)
+
+	assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url"))
+}
+
+func TestSQSReceiveMessageInput(t *testing.T) {
+	input := middleware.InitializeInput{
+		Parameters: &sqs.ReceiveMessageInput{
+			QueueUrl: aws.String("test-queue-url"),
+		},
+	}
+
+	attributes := SQSAttributeSetter(context.TODO(), input)
+
+	assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url"))
+}
+
+func TestSQSRemovePermissionInput(t *testing.T) {
+	input := middleware.InitializeInput{
+		Parameters: &sqs.RemovePermissionInput{
+			QueueUrl: aws.String("test-queue-url"),
+		},
+	}
+
+	attributes := SQSAttributeSetter(context.TODO(), input)
+
+	assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url"))
+}
+
+func TestSQSSendMessageBatchInput(t *testing.T) {
+	input := middleware.InitializeInput{
+		Parameters: &sqs.SendMessageBatchInput{
+			QueueUrl: aws.String("test-queue-url"),
+		},
+	}
+
+	attributes := SQSAttributeSetter(context.TODO(), input)
+
+	assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url"))
+}
+
+func TestSQSSendMessageInput(t *testing.T) {
+	input := middleware.InitializeInput{
+		Parameters: &sqs.SendMessageInput{
+			QueueUrl: aws.String("test-queue-url"),
+		},
+	}
+
+	attributes := SQSAttributeSetter(context.TODO(), input)
+
+	assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url"))
+}
+
+func TestSQSSetQueueAttributesInput(t *testing.T) {
+	input := middleware.InitializeInput{
+		Parameters: &sqs.SetQueueAttributesInput{
+			QueueUrl: aws.String("test-queue-url"),
+		},
+	}
+
+	attributes := SQSAttributeSetter(context.TODO(), input)
+
+	assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url"))
+}
+
+func TestSQSTagQueueInput(t *testing.T) {
+	input := middleware.InitializeInput{
+		Parameters: &sqs.TagQueueInput{
+			QueueUrl: aws.String("test-queue-url"),
+		},
+	}
+
+	attributes := SQSAttributeSetter(context.TODO(), input)
+
+	assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url"))
+}
+
+func TestSQSUntagQueueInput(t *testing.T) {
+	input := middleware.InitializeInput{
+		Parameters: &sqs.UntagQueueInput{
+			QueueUrl: aws.String("test-queue-url"),
+		},
+	}
+
+	attributes := SQSAttributeSetter(context.TODO(), input)
+
+	assert.Contains(t, attributes, semconv.MessagingURLKey.String("test-queue-url"))
+}
diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/test/go.mod b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/test/go.mod
index d332e1461..027a4d770 100644
--- a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/test/go.mod
+++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/test/go.mod
@@ -19,6 +19,7 @@ require (
 	github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.19 // indirect
 	github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.10 // indirect
 	github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.19 // indirect
+	github.com/aws/aws-sdk-go-v2/service/sqs v1.19.10 // indirect
 	github.com/davecgh/go-spew v1.1.1 // indirect
 	github.com/go-logr/logr v1.2.3 // indirect
 	github.com/go-logr/stdr v1.2.2 // indirect
diff --git a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/test/go.sum b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/test/go.sum
index f69e070f1..0a2797b1b 100644
--- a/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/test/go.sum
+++ b/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws/test/go.sum
@@ -1,7 +1,10 @@
+github.com/aws/aws-sdk-go-v2 v1.16.16/go.mod h1:SwiyXi/1zTUZ6KIAmLK5V5ll8SiURNUYOqTerZPaF9k=
 github.com/aws/aws-sdk-go-v2 v1.17.1 h1:02c72fDJr87N8RAC2s3Qu0YuvMRZKNZJ9F+lAehCazk=
 github.com/aws/aws-sdk-go-v2 v1.17.1/go.mod h1:JLnGeGONAyi2lWXI1p0PCIOIy333JMVK1U7Hf0aRFLw=
+github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.23/go.mod h1:2DFxAQ9pfIRy0imBCJv+vZ2X6RKxves6fbnEuSry6b4=
 github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.25 h1:nBO/RFxeq/IS5G9Of+ZrgucRciie2qpLy++3UGZ+q2E=
 github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.25/go.mod h1:Zb29PYkf42vVYQY6pvSyJCJcFHlPIiY+YKdPtwnvMkY=
+github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.17/go.mod h1:pRwaTYCJemADaqCbUAxltMoHKata7hmB5PjEXeu0kfg=
 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.19 h1:oRHDrwCTVT8ZXi4sr9Ld+EXk7N/KGssOr2ygNeojEhw=
 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.19/go.mod h1:6Q0546uHDp421okhmmGfbxzq2hBqbXFNpi4k+Q1JnQA=
 github.com/aws/aws-sdk-go-v2/service/dynamodb v1.17.3 h1:2oB4ikNEMLaPtu6lbNFJyTSayBILvrOfa2VfOffcuvU=
@@ -12,6 +15,9 @@ github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.19 h1:V03d
 github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.7.19/go.mod h1:2WpVWFC5n4DYhjNXzObtge8xfgId9UP6GWca46KJFLo=
 github.com/aws/aws-sdk-go-v2/service/route53 v1.22.4 h1:+dIaOyfJxK8ECZyJ+Y94ei51LhtGVMx+Yfwf7gMMorQ=
 github.com/aws/aws-sdk-go-v2/service/route53 v1.22.4/go.mod h1:kUSK8EkGYdzFbTmADk0t7yRIoESH80xjWe8Bp6dQce8=
+github.com/aws/aws-sdk-go-v2/service/sqs v1.19.10 h1:Y4civ9pg5cbQkSf/YGMfFZaIPAAAK61JV+NIzO8Ri4k=
+github.com/aws/aws-sdk-go-v2/service/sqs v1.19.10/go.mod h1:65Z/rmGw/6usiOFI0Tk4ddNUmPbjjPER1WLZwnFqxFM=
+github.com/aws/smithy-go v1.13.3/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
 github.com/aws/smithy-go v1.13.4 h1:/RN2z1txIJWeXeOkzX+Hk/4Uuvv7dWtCjbmVJcrskyk=
 github.com/aws/smithy-go v1.13.4/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=