Skip to content

How to enable boto3 SDK metric collection?

0

Hello, I am testing a POC that uses service discovery (specifically the DiscoverInstances API call in boto3). When we send lots of concurrent requests out, we are seeing some slowdown. We want to see if this slowdown is coming from client side, so we want to enable SDK metrics for the AWS SDK for Python.

I have been following the steps outlined here https://boto3.amazonaws.com/v1/documentation/api/1.17.109/guide/sdk-metrics.html, but the steps are quite vague and there is not much documentation available. Specifically, I believe my issue is in creating the config file for the Cloudwatch agent and in enabling SDK metrics to collect and send metrics. When I run my Python application, none of the SDK metrics show up in the Cloudwatch console. Is there anything available like this? https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/metrics.html

Thank you!

1 Answer
0

I think you are linking and referring to the correct documentation. The one thing I would add is this be aware of how retries and backoff work in the SDK. See below:

https://boto3.amazonaws.com/v1/documentation/api/1.17.109/guide/retries.html?highlight=backoff

Your AWS client might see calls to AWS services fail due to unexpected issues on the client side. Or calls might fail due to rate limiting from the AWS service you're attempting to call. In either case, these kinds of failures often don’t require special handling and the call should be made again, often after a brief waiting period. Boto3 provides many features to assist in retrying client calls to AWS services when these kinds of errors or exceptions are experienced.

This guide provides you with details on the following:

  • How to find the available retry modes and the differences between each mode
  • How to configure your client to use each retry mode and other retry configurations
  • How to validate if your client performs a retry attempt

Hope this helps!

AWS
EXPERT

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.