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

The terraform provider logdna does not handle rate limited responses #104

Open
luiof opened this issue Feb 20, 2024 · 1 comment
Open

The terraform provider logdna does not handle rate limited responses #104

luiof opened this issue Feb 20, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@luiof
Copy link

luiof commented Feb 20, 2024

We are trying to create resources on the LogDNA provided by IBM and when the set of resources to create is huge, we get always a rate limited response.

Error: Cannot read the remote view resource
│  with module.resource_alerts_all_ghost.logdna_view.resource_containers_crash,
│  on modules/ghost-all-generic/main.tf line 47, in resource "logdna_view" "resource_containers_crash":
│  47: resource "logdna_view" "resource_containers_crash" {
│ 
│ GET https://api.eu-gb.logging.cloud.ibm.com/v1/config/view/xxxxxxx, status 429 NOT OK! {"code":"ETOOMANY","message":"Rate limit exceeded","status":"429"}

image

The problem can be skipped in the apply since we can use some delays between the resources; but in the destroy the problem is still there and the terraform state is not consistent due to the rate limited responses.

This should be handled by the provider.

@jakedipity jakedipity added enhancement New feature or request good first issue Good for newcomers labels May 14, 2024
@jakedipity
Copy link
Contributor

This shouldn't be too difficult to implement. The logic in requestConfig.MakeRequest() can be extended to retry requests that fail with a 429 error code. I think adding parameters for max retries, exponential backoff, and jitter should all help with the problem described here.

Additionally those parameters should be exposed through the provider config so they can be fine-tuned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants