Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exporter/chronicleexporter/http_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ func (exp *httpExporter) uploadToChronicleHTTP(ctx context.Context, logs *api.Im
// TODO interpret with https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/internal/coreinternal/errorutil/http.go
statusErr := errors.New(resp.Status)
switch resp.StatusCode {
case http.StatusInternalServerError, http.StatusServiceUnavailable: // potentially transient
case http.StatusInternalServerError, http.StatusServiceUnavailable, http.StatusTooManyRequests: // potentially transient
return statusErr
default:
if exp.cfg.LogErroredPayloads {
Expand Down
19 changes: 19 additions & 0 deletions exporter/chronicleexporter/http_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,25 @@ func TestHTTPExporter(t *testing.T) {
expectedErr: "upload to chronicle: 503 Service Unavailable",
permanentErr: false,
},
{
name: "transient_error Too Many Requests",
handlers: map[string]http.HandlerFunc{
"FAKE": func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusTooManyRequests)
},
},
input: func() plog.Logs {
logs := plog.NewLogs()
rls := logs.ResourceLogs().AppendEmpty()
sls := rls.ScopeLogs().AppendEmpty()
lrs := sls.LogRecords().AppendEmpty()
lrs.Body().SetStr("Test")
return logs
}(),
expectedRequests: 1,
expectedErr: "upload to chronicle: 429 Too Many Requests",
permanentErr: false,
},
{
name: "permanent_error",
handlers: map[string]http.HandlerFunc{
Expand Down