aws-sdk-java-v2 icon indicating copy to clipboard operation
aws-sdk-java-v2 copied to clipboard

Allow attaching MetricPublisher for DynamoDBEnhanced and DynamoDBEnhancedAsyncClient client calls

Open swaranga opened this issue 4 years ago • 5 comments

Today, when I use the low level DynamoDBClient or DynamoDBAsyncClient, I can attach a MetricsPublisher to the underlying GetItemRequest, PutItemRequest etc. However if I decide to use the DynamoDBEnhancedClient or DynamoDBEnhancedAsyncClient, there is no way to attach similar MetricsPublisher instances to load and save calls.

I am aware that I can attach a MetricsPublisher to the underlying DynamoDBClient instance used by the DynamoDBEnhanceClient but I need to collect and publish metrics at each request level.

This is similar to how for normal GetItem calls I can attach MetricPublishers at individual request level.

swaranga avatar Jun 05 '21 05:06 swaranga

I see, DynamoDB Enhanced requests don't have the overrideConfiguration option. Not sure exactly which load and save calls you mean though.

Marking as a feature request.

debora-ito avatar Jun 16 '21 22:06 debora-ito

Sorry, the load and save calls were actually in the V1 DynamoDBMapper API. In the V2 enhanced client, they are more like getItem, putItem: https://aws.amazon.com/blogs/developer/introducing-enhanced-dynamodb-client-in-the-aws-sdk-for-java-v2/. And yes, the ability to do an overrideConfiguration for each request will solve this problem.

swaranga avatar Jun 16 '21 23:06 swaranga

Ping. Any updates?

swaranga avatar Jul 14 '21 00:07 swaranga

Ping. Any updates on this? Actually, do you take pull requests?

swaranga avatar Oct 12 '21 18:10 swaranga

Yes, we do take pull requests.

debora-ito avatar Oct 12 '21 20:10 debora-ito