Skip to content
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

handle cost management API throttling #2887

Merged

Conversation

guybartal
Copy link
Collaborator

@guybartal guybartal commented Nov 16, 2022

Resolves #2835

What is being addressed

handle 429 and 503 status codes returned from azure cost management when rate limiting is applied and when service is temporarily unavailable.

How is this addressed

  • propagate HTTP status codes 429, 503 from azure cost management api to client side with retry-after X seconds
  • when TRE cost api returns 429 or 503, UI will retry to fetch results after given number of seconds from the response
  • add Shimmer effect while loading costs in UI

Loading cost (Shimmer):

MicrosoftTeams-image

When loading cost fails - cost tag is hidden (In the future we might display in notification pane):
MicrosoftTeams-image (1)

When loaded:
MicrosoftTeams-image (2)

@github-actions
Copy link

github-actions bot commented Nov 16, 2022

Unit Test Results

518 tests   518 ✔️  14s ⏱️
    1 suites      0 💤
    1 files        0

Results for commit d04a076.

♻️ This comment has been updated with latest results.

@guybartal
Copy link
Collaborator Author

/test

@github-actions
Copy link

🤖 pr-bot 🤖

🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/3481788229 (with refid 467a1db2)

(in response to this comment from @guybartal)

Copy link
Collaborator

@jjgriff93 jjgriff93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just some spelling corrections

api_app/resources/strings.py Outdated Show resolved Hide resolved
api_app/api/routes/costs.py Outdated Show resolved Hide resolved
api_app/services/cost_service.py Outdated Show resolved Hide resolved
api_app/services/cost_service.py Outdated Show resolved Hide resolved
api_app/services/cost_service.py Outdated Show resolved Hide resolved
api_app/services/cost_service.py Outdated Show resolved Hide resolved
ui/app/src/components/root/RootLayout.tsx Outdated Show resolved Hide resolved
@guybartal guybartal mentioned this pull request Nov 20, 2022
@guybartal
Copy link
Collaborator Author

/test

@github-actions
Copy link

🤖 pr-bot 🤖

🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/3507869353 (with refid 467a1db2)

(in response to this comment from @guybartal)

@guybartal
Copy link
Collaborator Author

/test-destroy-env

@github-actions
Copy link

Destroying PR test environment (RG: rg-tre467a1db2)... (run: https://github.com/microsoft/AzureTRE/actions/runs/3508071787)

@github-actions
Copy link

PR test environment destroy complete (RG: rg-tre467a1db2)

@guybartal
Copy link
Collaborator Author

/test

@github-actions
Copy link

🤖 pr-bot 🤖

🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/3508499539 (with refid 467a1db2)

(in response to this comment from @guybartal)

@github-actions
Copy link

Destroying PR test environment (RG: rg-tre467a1db2)... (run: https://github.com/microsoft/AzureTRE/actions/runs/3508071787)

@github-actions
Copy link

PR test environment destroy complete (RG: rg-tre467a1db2)

@github-actions
Copy link

🤖 pr-bot 🤖

🏃 Running tests: https://github.com/microsoft/AzureTRE/actions/runs/3508499539 (with refid 467a1db2)

(in response to this comment from @guybartal)

@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:01 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:05 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:05 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:05 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:05 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:05 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:05 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:05 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:05 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:05 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:05 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:05 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:09 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:43 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:43 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:43 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:43 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:43 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:43 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:43 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:43 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:43 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:45 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:45 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 08:45 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 09:22 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 09:22 Inactive
@guybartal guybartal temporarily deployed to CICD November 21, 2022 09:24 Inactive
@github-actions
Copy link

E2E Test Results

17 tests  +17   17 ✔️ +17   4s ⏱️ +4s
  1 suites +  1     0 💤 ±  0 
  1 files   +  1     0 ±  0 

Results for commit d04a076. ± Comparison against base commit 50e5763.

@guybartal guybartal merged commit 813e090 into microsoft:main Nov 21, 2022
@guybartal guybartal deleted the guybartal-handle-cost-api-throtlling branch November 22, 2022 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants