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

API Rate limit throttle log_level #2027

Closed
exitcode0 opened this issue Jun 25, 2024 · 6 comments
Closed

API Rate limit throttle log_level #2027

exitcode0 opened this issue Jun 25, 2024 · 6 comments
Labels
enhancement Asking for new behavior or feature stale waiting-response Waiting on collaborator to responde to follow on disucussion

Comments

@exitcode0
Copy link
Contributor

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

It seems that the API rate limit log message is only printed to stdout when TF_LOG=DEBUG (Link)

Is it possible for this to be a configurable option?
If this was a config option, it would make it much easier to identify when API rate limits are impacting deployment times.
This would make it easier to identify when either:

  • Seek additional API quota
  • Divide my Terraform state into smaller pieces

New or Affected Resource(s)

  • provider "okta" {}

Potential Terraform Configuration

provider "okta" {
  max_api_capacity = 95

  # Valid options "TRACE", "DEBUG", "INFO", "WARN"
  # Default value could remain as "DEBUG" or optionally be changed to "INFO"
  max_api_capacity_loglevel = "INFO"
}

References

  • #0000
@exitcode0 exitcode0 added the enhancement Asking for new behavior or feature label Jun 25, 2024
@duytiennguyen-okta duytiennguyen-okta added the waiting-response Waiting on collaborator to responde to follow on disucussion label Jun 25, 2024
@duytiennguyen-okta
Copy link
Contributor

@exitcode0 If all you need for TF_LOG=debug to print somewhere other than stdout then you could add TF_LOG_PATH to the command. TF_LOG=DEBUG TF_LOG_PATH=TestAccOrderResource.log terraform apply is what I use when trying to see the issue. Let me know if that help

@exitcode0
Copy link
Contributor Author

Hey @duytiennguyen-okta
What I'd like to be able to achieve is to log when API rate limit back-offs are increasing plan/apply execution times
It's currently possible to infer that watching the logs as there will be a long pause between log output messages
Ideally i'd like to be able to log API rate limit back-offs without logging the additional information that is less relevant for this particular use-case

@duytiennguyen-okta
Copy link
Contributor

Can you show me an example of what it would look like in your opinion?

@exitcode0
Copy link
Contributor Author

The config could look something like this

provider "okta" {
  max_api_capacity = 95

  # Valid options "TRACE", "DEBUG", "INFO", "WARN"
  # Default value could remain as "DEBUG" or optionally be changed to "INFO"
  max_api_capacity_loglevel = "INFO"
}

As for the log message itself, something like the following would be great

data.okta_groups.aws_000000000000_admin: Reading...
data.okta_groups.aws_000000000000_admin: Read complete after 0s [id=142341]
data.okta_groups.aws_111111111111_admin: Reading...
data.okta_groups.aws_111111111111_admin: Read complete after 0s [id=831242]
Pausing for 15s for API Rate limit bucket '831BCAD8-3B01-496A-B4C4-378A01630562' - '/api/v1/grops/'
okta_app_saml.aws: Reading...
okta_app_saml.aws: Read complete after 0s [id=24215]
okta_app_saml.salesforce: Reading...
okta_app_saml.salesforce: Read complete after 0s [id=507622]
Pausing for 45s for API Rate limit bucket '3A6F5113-8401-4D95-8543-D2C3849655EC' - '/api/v1/apps/'
okta_app_saml.slack: Reading...
okta_app_saml.slack: Read complete after 0s [id=442216]
Pausing for 50s for API Rate limit bucket '3A6F5113-8401-4D95-8543-D2C3849655EC' - '/api/v1/apps/'

Copy link

github-actions bot commented Aug 4, 2024

This issue is stale because it has been open 60 days with no activity. Comment or this will be closed in 35 days

@github-actions github-actions bot added the stale label Aug 4, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 8, 2024
@exitcode0
Copy link
Contributor Author

@duytiennguyen-okta can this be re-opened, looks like stalebot did not correctly remove the waiting-response label after I replied

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Asking for new behavior or feature stale waiting-response Waiting on collaborator to responde to follow on disucussion
Projects
None yet
Development

No branches or pull requests

2 participants