opsgenie-python-sdk icon indicating copy to clipboard operation
opsgenie-python-sdk copied to clipboard

Rate limiting information

Open chills42 opened this issue 3 years ago • 2 comments

I'm not seeing any clear way to make use of the rate limiting header information while using the SDK. Ideally, it would be nice to have the header values accessible for clearer understanding of throttling.

https://docs.opsgenie.com/docs/api-rate-limiting

chills42 avatar Mar 05 '21 12:03 chills42

I think you can get insight into throttling by subscribing to metrics: https://docs.opsgenie.com/docs/opsgenie-python-api-v2-1#metrics-publishing-support

API Metrics include throttling information in the resultMetadata and HTTP Metrics include statusCode which will be 429 for throttled requests.

If you don't need it programmatically, I think information about throttled requests is also available in the logging output.

asqui avatar Mar 05 '21 19:03 asqui

Hmmm, on second thought, I think logging about throttled requests (and any other retries) is only available to me because of this patch I applied: BATS/opsgenie-python-sdk@13a731cb1d039a79b935e2eea0cb9082abb998d3

If this is more generally useful maybe the maintainers can consider including this in the official release?

asqui avatar Mar 05 '21 19:03 asqui