Hi team! has anyone added throttling to one of the...
# singer-tap-development
e
Hi team! has anyone added throttling to one of their tap? We’re working on tap-github (https://github.com/MeltanoLabs/tap-github) and would like to add a throttle of one request per second (as suggested by the API doc). Is that something supported by the SDK already? I did a search on Slack and in the SDK code but no luck… Thanks for your help!
There was just an MR merged that implemented this into the SDK, samples here https://sdk.meltano.com/en/latest/code_samples.html#custom-backoff
e
Yeah. I think the SDK currently does a better job at reacting to upstream rate limits rather being proactive and throttling itself but it's possible and somewhere in that thread I might've linked to tap-stackexchange. It uses `ratelimit`'s
RateLimitException
which is raised in any of three places: the library's
sleep_and_retry
, in
.validate_response
if there's a backoff in the response and also in
.validate_response
if any "retry-able" error is raised.
e
Yeah I think our tap covers rate limiting pretty well at this point, including token rotation, but as you pointed out I’m looking for throttling that is imposed by the tap and not “reacting”