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

TT-10564 Splunk backoff retry #758

Merged
merged 22 commits into from
Jan 4, 2024
Merged

TT-10564 Splunk backoff retry #758

merged 22 commits into from
Jan 4, 2024

Conversation

mativm02
Copy link
Contributor

This PR is a duplicated of #745

Introduce an expotential backoff retry mechanism for sending logs to spunk to mitigate the chance of losing logs if pump fails to send logs to spunk (i.e. due to network issue or rate limit being hit). Also fixes bug where pump not closing connections after receiving response. Also spunk responses were not being checked i.e. a 404 could be returned and pump would still mark as successful pump export.

Description

Related Issue

Motivation and Context

How This Has Been Tested

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • Make sure you are requesting to pull a topic/feature/bugfix branch (right side). If pulling from your own
    fork, don't request your master!
  • Make sure you are making a pull request against the master branch (left side). Also, you should start
    your branch off our latest master.
  • My change requires a change to the documentation.
    • If you've changed APIs, describe what needs to be updated in the documentation.
  • I have updated the documentation accordingly.
  • Modules and vendor dependencies have been updated; run go mod tidy && go mod vendor
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • Check your code additions will not fail linting checks:
    • go fmt -s
    • go vet

Copy link

sweep-ai bot commented Dec 28, 2023

Apply Sweep Rules to your PR?

  • Apply: All new business logic should have corresponding unit tests.
  • Apply: Refactor large functions to be more modular.
  • Apply: Add docstrings to all functions and file headers.

@mativm02 mativm02 mentioned this pull request Dec 28, 2023
14 tasks
@buger
Copy link
Member

buger commented Dec 28, 2023

API tests result - mongo44-murmur64 env: skipped 🚫
Branch used: refs/heads/release-1.9
Commit: 35e1e74
Triggered by: push (@mativm02)
Execution page

@buger
Copy link
Member

buger commented Dec 28, 2023

API tests result - postgres15-sha256 env: skipped 🚫
Branch used: refs/heads/release-1.9
Commit: 35e1e74
Triggered by: push (@mativm02)
Execution page

@buger
Copy link
Member

buger commented Dec 28, 2023

API tests result - postgres15-murmur64 env: skipped 🚫
Branch used: refs/heads/release-1.9
Commit: 35e1e74
Triggered by: push (@mativm02)
Execution page

@buger
Copy link
Member

buger commented Dec 28, 2023

API tests result - mongo44-sha256 env: skipped 🚫
Branch used: refs/heads/release-1.9
Commit: 35e1e74
Triggered by: push (@mativm02)
Execution page

README.md Outdated Show resolved Hide resolved
pumps/splunk_test.go Outdated Show resolved Hide resolved
@mativm02 mativm02 requested a review from sredxny December 29, 2023 13:09
@mativm02 mativm02 enabled auto-merge (squash) January 4, 2024 13:26
@mativm02 mativm02 merged commit 35e1e74 into master Jan 4, 2024
13 checks passed
@mativm02 mativm02 deleted the domsolutions-splunk-retry branch January 4, 2024 13:43
@mativm02
Copy link
Contributor Author

mativm02 commented Jan 4, 2024

/release to release-1.8

Copy link

tykbot bot commented Jan 4, 2024

Working on it! Note that it can take a few minutes.

tykbot bot pushed a commit that referenced this pull request Jan 4, 2024
* splunk backoff retry mechanism to reduce chance of losing logs

* only retry for temporary errors

* move to separate pkg outside of pumps

* set correct collector url

* ensure connection can be reused by reading and closing body stream

* reset req body to fix error when req body has already been read from previous failed request

* tidy up, change retry log to warning as not yet error

* add debugging for body bytes sent to splunk & RTT to aid in fine tuning batch size

* PR requested changes

* fix go linter issue

* applying suggested changes

* linting

---------

Co-authored-by: dominicriordan <[email protected]>
Co-authored-by: domsolutions <[email protected]>

(cherry picked from commit 35e1e74)
Copy link

tykbot bot commented Jan 4, 2024

@mativm02 Succesfully merged PR

@mativm02
Copy link
Contributor Author

mativm02 commented Jan 4, 2024

It's merged! Thank you for your contribution @domsolutions, it's really appreciated.

buger added a commit that referenced this pull request Jan 4, 2024
TT-10564 Splunk backoff retry (#758)

* splunk backoff retry mechanism to reduce chance of losing logs

* only retry for temporary errors

* move to separate pkg outside of pumps

* set correct collector url

* ensure connection can be reused by reading and closing body stream

* reset req body to fix error when req body has already been read from previous failed request

* tidy up, change retry log to warning as not yet error

* add debugging for body bytes sent to splunk & RTT to aid in fine tuning batch size

* PR requested changes

* fix go linter issue

* applying suggested changes

* linting

---------

Co-authored-by: dominicriordan <[email protected]>
Co-authored-by: domsolutions <[email protected]>
@domsolutions
Copy link
Contributor

It's merged! Thank you for your contribution @domsolutions, it's really appreciated.

No problem!

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

Successfully merging this pull request may close these issues.

4 participants