feat: add rate limit logging to HttpClient and WaitTimeFromHeaderBackoffStrategy#899
Draft
devin-ai-integration[bot] wants to merge 4 commits intomainfrom
Draft
feat: add rate limit logging to HttpClient and WaitTimeFromHeaderBackoffStrategy#899devin-ai-integration[bot] wants to merge 4 commits intomainfrom
devin-ai-integration[bot] wants to merge 4 commits intomainfrom
Conversation
…offStrategy Co-Authored-By: alexandre@airbyte.io <alexandre@airbyte.io>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This CDK VersionYou can test this version of the CDK using the following: # Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@devin/1770342217-rate-limit-logging#egg=airbyte-python-cdk[dev]' --help
# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch devin/1770342217-rate-limit-loggingPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
Co-Authored-By: alexandre@airbyte.io <alexandre@airbyte.io>
1 task
Co-Authored-By: alexandre@airbyte.io <alexandre@airbyte.io>
Co-Authored-By: alexandre@airbyte.io <alexandre@airbyte.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: add rate limit logging to HttpClient and WaitTimeFromHeaderBackoffStrategy
Summary
Adds INFO-level logging for rate limit events in two places in the CDK:
WaitTimeFromHeaderBackoffStrategy: Logs whenever a rate limit header value is successfully extracted from a response — includes the header name, parsed value, and HTTP status code.HttpClient._handle_error_resolution:RATE_LIMITEDstream status message is emitted to the platform (theprint()call that sends the status to stdout).No new configuration or schema changes. No behavioral changes beyond additional log lines.
Review & Testing Checklist for Human
RETRY,RATE_LIMITED,REFRESH_TOKEN_THEN_RETRY), not just rate limits. The log message says "Rate limit backoff" which is misleading when the action is a genericRETRY. Consider renaming to something more generic like "Backoff" or gating it behindresponse_action == ResponseAction.RATE_LIMITED.WaitTimeFromHeaderBackoffStrategylog fires on every call tobackoff_time()where the header is present, not only when rate limiting is triggered. For connectors that always include rate limit headers in responses (even successful ones that are retried for other reasons like 403), this could produce logs that look like rate limit events but aren't. Confirm this matches the intended behavior of "log only when rate limit is triggered."request.urlis logged and may contain resource IDs (e.g., order IDs in path segments). This is consistent with existing logging in the same file but worth confirming it meets the "no customer data" requirement.Notes
components.pyinairbytehq/airbyte).