-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fix(node): Make log flushing logic more robust #15991
Conversation
@@ -25,6 +25,9 @@ import { resolvedSyncPromise } from './utils-hoist/syncpromise'; | |||
import { _INTERNAL_flushLogsBuffer } from './logs/exports'; | |||
import { isPrimitive } from './utils-hoist'; | |||
|
|||
// TODO: Make this configurable | |||
const DEFAULT_LOG_FLUSH_INTERVAL = 5000; |
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.
This also exists in the browser SDK.
I'm going to create another PR after this that unifies this as a logging option, and update the develop docs as well.
size-limit report 📦
|
resolves https://linear.app/getsentry/issue/LOGS-18
We got some user feedback that nodejs logging was too inconsistent. This PR improves that.
flushLogs
client hook that allows us to reset server weight tracking logic more consistently. This also fixes a bug where we didn't reset weight tracking when callingSentry.flush
.process.on('beforeExit'
listener to flush logs. Hooking ontobeforeExit
does not guarantee we flush all logs before exit, but it does increase the chances we do.