-
Notifications
You must be signed in to change notification settings - Fork 879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWS SDK instrumentation - DynamoDB attributes #2262
Conversation
Is the timing coincidentally the same as reviving my spec pr? Guessing not but interestingly close :) open-telemetry/opentelemetry-specification#1422 Sorry I didn't get to look at the code yet at all but if you can compare with that and see any possible improvements on both sides, or otherwise confirm they aren't really related, that would be great and will check this out more by Monday |
@anuraaga pure coincidence, but out of exactly the same reason - I was busy end of last year but got some extra time now ;) Proposed PR aims to provide implementation for setting attributes, without defining them - I planned to use your drafted sem convs :) |
...2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/DbRequestDecorator.java
Outdated
Show resolved
Hide resolved
...-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/DynamoDbRequest.java
Outdated
Show resolved
Hide resolved
@anuraaga please have a look - updated the code for the initial implementation. If the direction is ok, I'll add rest of DynamoDb requests (hardcoded for now), some tests and a bit of clean up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for helping with this! Generally looks good
...dk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdkRequest.java
Outdated
Show resolved
Hide resolved
...-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/FieldMapper.java
Outdated
Show resolved
Hide resolved
...-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/FieldMapper.java
Outdated
Show resolved
Hide resolved
@anuraaga another revision (with AWS SDK marshalling). Please have a look (will add more tests! :) ). |
instrumentation/aws-sdk/aws-sdk-2.2/library/aws-sdk-2.2-library.gradle
Outdated
Show resolved
Hide resolved
instrumentation/aws-sdk/aws-sdk-2.2/library/aws-sdk-2.2-library.gradle
Outdated
Show resolved
Hide resolved
.../src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/TracingExecutionInterceptor.java
Show resolved
Hide resolved
...sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/FieldMapping.java
Outdated
Show resolved
Hide resolved
...sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/FieldMapping.java
Outdated
Show resolved
Hide resolved
....2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdkRequestType.java
Show resolved
Hide resolved
...s-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/Serializer.java
Outdated
Show resolved
Hide resolved
Function<String, Object> fieldValueProvider, FieldMapping fieldMapping, Span span) { | ||
// traverse path | ||
String[] path = fieldMapping.getFields(); | ||
Object target = fieldValueProvider.apply(camelCase(path[0])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This camelCase()
call wouldn't be needed if fields in AwsSdkRequestType
were already camelCased, would it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, here's the deal - in AWS model, fields are CamelCased, but getters start with lowercase (FieldName vs fieldName). First field in a path is retrieved by getFieldValue call which takes field name, rest is retrieved with getter call. So either way we're going to transform the name, assuming we want to stay consistent with naming (avoid putting first camel cased and rest lowercased).
...g/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2ClientTest.groovy
Show resolved
Hide resolved
...-2.2/library/src/test/java/io/opentelemetry/instrumentation/awssdk/v2_2/FieldMapperTest.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot!
...-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/FieldMapper.java
Outdated
Show resolved
Hide resolved
...s-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/Serializer.java
Show resolved
Hide resolved
...s-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/Serializer.java
Show resolved
Hide resolved
...s-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/Serializer.java
Outdated
Show resolved
Hide resolved
...k-2.2/library/src/test/java/io/opentelemetry/instrumentation/awssdk/v2_2/SerializerTest.java
Show resolved
Hide resolved
...g/src/main/groovy/io/opentelemetry/instrumentation/awssdk/v2_2/AbstractAws2ClientTest.groovy
Outdated
Show resolved
Hide resolved
@mateuszrzeszutek @anuraaga please have another look, resolved all comments. Notable changed:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, just nits
....2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/AwsSdkRequestType.java
Outdated
Show resolved
Hide resolved
...s-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/Serializer.java
Outdated
Show resolved
Hide resolved
...s-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/Serializer.java
Outdated
Show resolved
Hide resolved
...s-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/Serializer.java
Outdated
Show resolved
Hide resolved
Nits done :) Awaiting merge (or an additional review ;) ). |
Closes #1198
Currently as PoC, after discussions concerning the previous attempt (custom "query" creation per DynamoDb operation).
Goals:
Remarks:
@anuraaga @trask please have a look - I'm primarily looking for validation of the presented approach :)