AWS SDK Instrumentation should use AWS SDK values for `rpc` attributes
See original GitHub issueDescription
In the aws sdk instrumentation package, rpc
attributes are set from the normalizedRequest
.
normalizedRequest
(v2 and v3) modify the request metadata values returned from the AWS SDK like this:
Specifically:
- It converts the
service
name.toLowerCase()
- It converts the
operation
name.toCamelCase()
However, the specs for AWS SDK instrumentation give examples that contradict these patterns.
- ref: rpc.service
brief: "The name of the service to which a request is made, as returned by the AWS SDK."
examples:
- DynamoDB
- S3
- ref: rpc.method
brief: "The name of the operation corresponding to the request, as returned by the AWS SDK"
examples:
- GetItem
- PutItem
Action Items
Based on the examples, we should return S3
instead of s3
and ListBuckets
instead of listBuckets
(for example).
This means using toUpperCase()
and a modified version of toCamelCase()
with the first character Upper Case.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:14 (9 by maintainers)
Top Results From Across the Web
AWS X-Ray Exporter should map `rpc` values to `aws` values
* value that the AWS-XRay backend understands. Specifically: rpc.service -> aws.service; rpc.method -> aws.operation; rpc.system is already used ...
Read more >opentelemetry-instrumentation-aws-sdk - npm
Span Attributes ; rpc.service, string, The name of the service to which a request is made, as returned by the AWS SDK.
Read more >Developing with Amazon S3 using the AWS SDKs, and ...
This section provides an overview of using AWS SDKs for developing Amazon S3 applications. This section also describes how you can test the...
Read more >Set Amazon SNS topic attributes using an AWS SDK
The following code examples show how to set Amazon SNS topic attributes. Java. SDK for Java 2.x. Note.
Read more >AWS X-Ray concepts
You choose the data to collect by modifying your application configuration or code to instrument incoming requests, downstream requests, and AWS SDK clients ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@anuraaga please take a look, it seems like the spec could use some improvement in that area.
Thank you @Oberon00 for taking the time to read and comment here. I agree with your comment in general. Unfortunately, for aws-sdk js the situation is very complex:
in v2, the operation name is set with PascalCase in the apis (see example) but then later on changed to camelCase somewhere in the code which is what is accessible to the patching code. in v3, both the service name and the method are not accessible at all! there is simply no way to retrieve them other than extracting them from the class name or digging into some very deep private attributes which are not structured or documented.
I think that the sentence “as returned by the AWS SDK” is simply not valid for JS sdk specifically.
Since the spec is (deliberately?) blurry about what value should be set for these attributes, I’m ok with applying common sense and produce values (i.e
PascalCase
) that are consistent between v2, v3, the generic API reference, and the examples in otel spec. However, I will be happy if someone wants to take this issue, research all the complexity, and lead a discussion in the spec repo or anywhere else. I can help with such effort but it’s too time-consuming for me to lead it myself.