Skip to content

Commit

Permalink
Merge pull request #4864 from consideRatio/pr/fail-loud
Browse files Browse the repository at this point in the history
aws-ce-grafana-backend: ensure loud failure on a need for pagination handling
  • Loading branch information
consideRatio authored Sep 23, 2024
2 parents 1e524cb + 87311ea commit bc4f68a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions helm-charts/aws-ce-grafana-backend/mounted-files/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ def query_aws_cost_explorer(metrics, granularity, from_date, to_date, filter, gr
Filter=filter,
GroupBy=group_by,
)
# FIXME: Handle pagination, but until this is a need, error loudly instead
# of accounting partial costs only.
if response.get("NextPageToken"):
raise ValueError(
f"A query with from '{from_date}' and to '{to_date}' led to "
"aws-ce-grafana-backend needing to handle a paginated response "
"and that hasn't been worked yet, it needs to be fixed."
)

return response


Expand Down

0 comments on commit bc4f68a

Please sign in to comment.