-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Be able to calculate sizes of PutMetricData
requests client-side
#4441
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
Comments
Hi @ianvernon thanks for bringing this up. We have discussed and this feature would be a good addition. However, the team has no bandwidth to work on this feature at the moment. We can work on a timeline on feature requests later on, but you are welcome to help us implement the feature. |
Until there is an official solution, I found that doing something like the following has been helpful for calculating request size:
I can't be sure that this gives an accurate request length, but I've stopped getting |
We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue. |
I still think this would be useful. |
Comments on closed issues are hard for our team to see. |
Describe the feature
Right now, there is no clear way to know whether a request that is generated client-side will exceed 40 KiB request size limit for
PutMetricData
requests. Exposing this to clients will allow them to craft requests toPutMetricData
that maximize the amount of datapoints per-request without exceeding the per-request limit.Use Case
PutMetricData
has many restrictions on its use, specifically:The rate limit motivates clients to pack as many values as possible (3,000) per request, but to do so in a way that does not exceed the 40 kilobyte / request limit. It would be nice if there were a way to expose what the size of a request is client-side so that we don't hit errors like:
Proposed Solution
A function should be exposed for a
cloudwatch.PutMetricDataInput
which calculates the size of the request so that clients can determine whether or not they need to split up a singlecloudwatch.PutMetricDataInput
into multiple, smallercloudwatch.PutMetricDataInput
s. Additionally, it would be useful to have the size calculated with or without gzip compression enabled.Other Information
No response
Acknowledgements
SDK version used
v1.44.33
Environment details (Version of Go (
go version
)? OS name and version, etc.)go version go1.17.6 linux/amd64
The text was updated successfully, but these errors were encountered: