-
Notifications
You must be signed in to change notification settings - Fork 11
feat(node-sdk): add configurable exit event flushing #311
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Introduce `flushOnExit` option in batch buffer configuration - Add new `flusher.ts` module to handle graceful process exit and event flushing - Update client initialization to conditionally register exit flush handler - Enhance README with documentation about exit flushing behavior - Add comprehensive test coverage for exit flushing mechanism
- Add test to verify no exit flush handler when `offline` is true - Add test to ensure no data is flushed when in offline mode
Contributor
Contributor
Author
roncohen
reviewed
Feb 10, 2025
roncohen
reviewed
Feb 10, 2025
roncohen
reviewed
Feb 11, 2025
roncohen
approved these changes
Feb 11, 2025
Contributor
roncohen
left a comment
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.
looks good after the current comments have been resolved 👍
Introduces `withTimeout()` and `TimeoutError` to provide a robust way of adding timeouts to promises. The new utility allows wrapping promises with a configurable timeout, rejecting with a custom error if the promise doesn't resolve within the specified time.
Use the new `withTimeout()` utility to replace manual Promise.race() implementation in flusher, improving error handling and readability
- Remove manual host configuration in bucket example - Add dotenv import in serve example to load environment variables
Update the exit code calculation in signal handling to use 0x80 instead of 0x100, ensuring consistent exit code behavior
roncohen
pushed a commit
that referenced
this pull request
Feb 21, 2025
This PR Introduces `flushOnExit` option in batch buffer configuration. When on (default), the client will flush all events on it's exit.
roncohen
pushed a commit
that referenced
this pull request
Feb 25, 2025
This PR Introduces `flushOnExit` option in batch buffer configuration. When on (default), the client will flush all events on it's exit.
roncohen
pushed a commit
that referenced
this pull request
Feb 26, 2025
This PR Introduces `flushOnExit` option in batch buffer configuration. When on (default), the client will flush all events on it's exit.
roncohen
pushed a commit
that referenced
this pull request
Feb 26, 2025
This PR Introduces `flushOnExit` option in batch buffer configuration. When on (default), the client will flush all events on it's exit.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


This PR Introduces
flushOnExitoption in batch buffer configuration. When on (default), the client will flush all events on it's exit.