confluentinc / terraform-provider-confluent

Terraform Provider for Confluent
Apache License 2.0
27 stars 63 forks source link

Provide status code in an error message if http requests fails with "giving up after 5 attempt(s)" #297

Open linouk23 opened 1 year ago

linouk23 commented 1 year ago

What

By default, TF provider retries 4 times on 5xx / 429 errors from the backend but when it ultimately fails it returns an error message similar to

Error: error reading Kafka ACLs: Get "https://api.confluent.cloud/foo/bar": GET https://api.confluent.cloud/foo/bar giving up after 5 attempt(s)

so it's not clear whether it was a backend failure (with returning 5xx) or a ratelimit issue (429).

Before

Error: error reading Kafka ACLs: Get "https://api.confluent.cloud/foo/bar": GET https://api.confluent.cloud/foo/bar giving up after 5 attempt(s)

After

Error: error reading Kafka ACLs: Get "https://api.confluent.cloud/foo/bar": GET https://api.confluent.cloud/foo/bar giving up after 5 attempt(s): 429
andreniklasson commented 1 year ago

Is the rate limit universal or based on your customer plan with confluent?

linouk23 commented 1 year ago

@andreniklasson in general it's universal.

minionOfZuul commented 7 months ago

Adding my +1. Also, it would be nice to surface the rate limit response headers to the user, possibly as debug logging.