You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Performance Insights call get_resource_metrics truncates the response without notifying caller. This happens both with and without specifying the maximum number of results.
Expected Behavior
According to the documentation:
MaxResults (integer) – The maximum number of items to return in the response. If more items exist than the specified MaxRecords value, a pagination token is included in the response so that the remaining results can be retrieved.
I would expect that either the documentation is correct, or that if the documentation is incorrect, that a request with more data than can be returned in a single call will result in the presence of a NextToken value.
Current Behavior
When calling with MaxResults equal to one and a time window of several minutes to several days w/ a 60 second rollup, the response does not contain a NextToken as specified in the documentation.
When calling without MaxResults and a time window of several days, the response truncates to ~350 results without a NextToken.
Reproduction Steps
NOTE: This RDS instance has 7 days of PI retention, and as of the moment of writing this bug, the requested start time
There's a potential workaround, but I'm leery of using it as it seems brittle according to the documentation (see below). From inspection of results, AlignedStartTime matches up with the earliest date present in the results. IF I can rely on that counter to what the documentation says, then it would be on me to inspect AlignedStartTime (and potentially the time delta from AlignedEndTime) and split my calls into multiple smaller time windows and recombine later.
AlignedStartTime (datetime) –
The start time for the returned metrics, after alignment to a granular boundary (as specified by PeriodInSeconds). AlignedStartTime will be less than or equal to the value of the user-specified StartTime.
AlignedEndTime (datetime) –
The end time for the returned metrics, after alignment to a granular boundary (as specified by PeriodInSeconds). AlignedEndTime will be greater than or equal to the value of the user-specified Endtime.
Describe the bug
The Performance Insights call
get_resource_metrics
truncates the response without notifying caller. This happens both with and without specifying the maximum number of results.Expected Behavior
According to the documentation:
I would expect that either the documentation is correct, or that if the documentation is incorrect, that a request with more data than can be returned in a single call will result in the presence of a
NextToken
value.Current Behavior
When calling with
MaxResults
equal to one and a time window of several minutes to several days w/ a 60 second rollup, the response does not contain aNextToken
as specified in the documentation.When calling without
MaxResults
and a time window of several days, the response truncates to ~350 results without aNextToken
.Reproduction Steps
NOTE: This RDS instance has 7 days of PI retention, and as of the moment of writing this bug, the requested start time
Possible Solution
There's a potential workaround, but I'm leery of using it as it seems brittle according to the documentation (see below). From inspection of results,
AlignedStartTime
matches up with the earliest date present in the results. IF I can rely on that counter to what the documentation says, then it would be on me to inspectAlignedStartTime
(and potentially the time delta fromAlignedEndTime
) and split my calls into multiple smaller time windows and recombine later.Additional Information/Context
Link to boto3 documentation: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/pi/client/get_resource_metrics.html
SDK version used
1.28.3
Environment details (OS name and version, etc.)
MacOS 12.6.6 w/ Python 3.10.12
The text was updated successfully, but these errors were encountered: