Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Splunk/Custom HTTP Retry Codes #9371

Closed
meehanman opened this issue Sep 9, 2024 · 3 comments
Closed

Splunk/Custom HTTP Retry Codes #9371

meehanman opened this issue Sep 9, 2024 · 3 comments
Assignees

Comments

@meehanman
Copy link

meehanman commented Sep 9, 2024

When Splunk is having a bad time, you'll get a 408 - Your request timed out. Try again. but both the out_http and out_splunk plugins will never retry :face_palm:

out_http

if (c->resp.status >= 400 && c->resp.status < 500 && c->resp.status != 429) {
    flb_plg_warn(ctx->ins, "could not flush records to %s:%i (http_do=%i), "
                    "chunk will not be retried",
                    ctx->host, ctx->port, ret);
    out_ret = FLB_ERROR;
}

out_splunk

/*
    * Requests that get 4xx responses from the Splunk HTTP Event
    * Collector will 'always' fail, so there is no point in retrying
    * them:
    *
    * https://docs.splunk.com/Documentation/Splunk/8.0.5/Data/TroubleshootHTTPEventCollector#Possible_error_codes
    */
ret = (c->resp.status < 400 || c->resp.status >= 500) ?
    FLB_RETRY : FLB_ERROR;

Describe the solution you'd like

The Splunk out plugin requires more conformity to the Troubleshooting Documentation that they provide that indicates that 408 and 429 HTTP results should constitute a retry and not return FLB_ERROR.

The HTTP out Plugin would be great to add additional options to Configuring Retries that will allow more configuration to the retry logic such as the addition of additional HTTP codes we would want to retry with eg. if you wanted to retry with HTTP code 666 you could. In theory, we'd just want to add 408 and 429 to the list.

Describe alternatives you've considered

We only really have the option of setting up some intermediary proxy server that would proxy the requests correctly to give it a retryable HTTP response code if there is a 4xx error.

@meehanman meehanman changed the title Splunk/Custom Retries Splunk/Custom HTTP Retry Codes Sep 9, 2024
@agup006
Copy link
Member

agup006 commented Sep 10, 2024

@cosmo0920 is this something we could add for next sprint?

@cosmo0920
Copy link
Contributor

Hi, I sent PRs to extend retrying handlings for HTTP status codes for 408 and 429.

@cosmo0920 cosmo0920 self-assigned this Sep 11, 2024
@cosmo0920
Copy link
Contributor

This could be marked as done. Due to two PRs are merged into master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants