Skip to content

Commit

Permalink
Retry on 502 and 504 (#2438)
Browse files Browse the repository at this point in the history
  • Loading branch information
trask authored Aug 10, 2022
1 parent e8dbd4a commit 91623fd
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@
package com.azure.monitor.opentelemetry.exporter.implementation.utils;

public enum StatusCode {
TEMPORARY_REDIRECT(307),
PERMANENTY_REDIRECT(308),
UNAUTHORIZED(401),
FORBIDDEN(403),
REQUEST_TIMEOUT(408),
TOO_MANY_REQUESTS(429),
INTERNAL_SERVER_ERROR(500),
BAD_GATEWAY(502),
SERVICE_UNAVAILABLE(503),
TEMPORARY_REDIRECT(307),
PERMANENTY_REDIRECT(308);
GATEWAY_TIMEOUT(504);

private final int code;

Expand All @@ -43,7 +45,9 @@ public static boolean isRetryable(int statusCode) {
|| statusCode == REQUEST_TIMEOUT.code
|| statusCode == TOO_MANY_REQUESTS.code
|| statusCode == INTERNAL_SERVER_ERROR.code
|| statusCode == SERVICE_UNAVAILABLE.code;
|| statusCode == BAD_GATEWAY.code
|| statusCode == SERVICE_UNAVAILABLE.code
|| statusCode == GATEWAY_TIMEOUT.code;
}

public static boolean isRedirect(int statusCode) {
Expand Down

0 comments on commit 91623fd

Please sign in to comment.