Request to implement retry logic with delay mechanism when outgoing API calls to Zendesk fail with the 429 rate limit error

XMLWordPrintable

    • 1

      Issue Summary

      Outgoing Opsgenie to Zendesk API calls can periodically hit Zendesk's Rate Limits and thus failing with the 429 error.  This results in Zendesk Tickets not being closed when the corresponding Opsgenie alerts are closed.

      Most of the "setStatusToSolved" and "addInternalComment" actions were "successfully sent", however, periodically some would "failed to send", for example:

      [system] [ZendeskV2-Opsgenie Alerts to Zendesk Tickets (Support)] Failed to send [setStatusToSolved], reason: 429 Too Many Requests: "{"errors":[{"code":"tickets-update","title":"Ticket update API threshold exceeded","status":429}]}"
      
      system] [ZendeskV2-Opsgenie Alerts to Zendesk Tickets (Support)] Failed to send [addInternalComment], reason: 429 Too Many Requests: "{"errors":[{"code":"tickets-update","title":"Ticket update API threshold exceeded","status":429}]}"
      
      [ZendeskV2-Opsgenie Alerts to Zendesk Tickets (Support)] Failed to send [setStatusToSolved], will not retry.
       exception: org.springframework.web.client.HttpClientErrorException$TooManyRequests: 429 Too Many Requests: "{"errors":[{"code":"tickets-update","title":"Ticket update API threshold exceeded","status":429}]}" 
      

      Suggested Solutions

      Suggest implementing a retry logic with delay mechanism as suggested in this Zendesk Rate Limits document:

      "You can use the following response headers to confirm the account's current rate limit and monitor the number of requests remaining in the current minute:

      X-Rate-Limit: 700
      X-Rate-Limit-Remaining: 699
      

      If the rate limit is exceeded, the API responds with a 429 Too Many Requests status code. The response also has a Retry-After header that tells you how many seconds to wait before retrying API requests. Ensure your code handles 429 errors and waits the Retry-After interval before retrying requests."

      Workaround

      Currently there is no known workaround for this behavior other than subscribing to a Zendesk Suite plan with a higher rate limit (where available) or use additional filters to limit the number of tickets sent to Zendesk.

            Assignee:
            Unassigned
            Reporter:
            Wei Wung (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: