-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[filebeat][streaming] - Added retry functionality to websocket connections #40601
Conversation
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
@rdner, can I get a CODEOWNER review on this. |
Thanks for the ping. I've reviewed the PR, and it looks good. |
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
@belimawr, Addressed the PR comments. |
var closeErr *websocket.CloseError | ||
if errors.As(err, &closeErr) { | ||
switch closeErr.Code { | ||
case websocket.CloseGoingAway, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to use https://pkg.go.dev/github.com/gorilla/websocket#IsCloseError here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IsCloseError will require us to pass all the possible codes in the func param which can seem a bit messy when we are dealing with so many types of codes. It can be used but the signature is messy compared to the switch statement.
…tions (#40601) * added websocket retry logic, added input & config tests and updated docs * updated changelog * fixed function name spelling error * added a retryable error check * addressed PR comments * passed metrics to handleConnectionResponse to track errors * addressed PR suggestions * updated retry dial signature (cherry picked from commit 0c3c9c6) # Conflicts: # x-pack/filebeat/input/streaming/websocket.go
Type of change
Please label this PR with one of the following labels, depending on the scope of your change:
Proposed commit message
Added retry functionality to websocket connections under the streaming input. Docs & tests have been updated accordingly to support the new functionality.
Checklist
- [ ] I have made corresponding change to the default configuration filesCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Disruptive User Impact
None
Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs