-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(core): Add client outcomes for breadcrumbs buffer #15082
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
Conversation
size-limit report 📦
|
this._breadcrumbs.push(mergedBreadcrumb); | ||
if (this._breadcrumbs.length > maxCrumbs) { | ||
this._breadcrumbs = this._breadcrumbs.slice(-maxCrumbs); | ||
this._client?.recordDroppedEvent('buffer_overflow', 'log_item'); | ||
} |
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.
Do we even need to push the breadcrumb if the length is already overflowing? 🤔
Correct me if I understood it wrong.
this._breadcrumbs.push(mergedBreadcrumb); | |
if (this._breadcrumbs.length > maxCrumbs) { | |
this._breadcrumbs = this._breadcrumbs.slice(-maxCrumbs); | |
this._client?.recordDroppedEvent('buffer_overflow', 'log_item'); | |
} | |
if (this._breadcrumbs.length >= maxCrumbs) { | |
this._client?.recordDroppedEvent('buffer_overflow', 'log_item'); | |
} else { | |
this._breadcrumbs.push(mergedBreadcrumb); | |
} |
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.
I chose to keep the old behaviour of always pushing a breadcrumb, and conditionally calling truncating logic.
If we think about the buffer always trying to maintain max capacity, this makes the most sense. I don't think it's too much of a cost to keep the extra element in the buffer.
ref getsentry/team-sdks#116 This PR implements a new client discard reason for `buffer_overflow`. This will be used to track when the internal breadcrumbs buffer overflows for the new logs product that we are working on. This is documented in develop here: getsentry/sentry-docs#12395 Note: The reason we have `buffer_overflow` as a separate item to `queue_overflow` is that in the future when we send log items in envelopes we'll increment `queue_overflow` for the transport queue. We want to differentiate between the transport queue and the internal buffer explicitly.
ref getsentry/team-sdks#116
This PR implements a new client discard reason for
buffer_overflow
. This will be used to track when the internal breadcrumbs buffer overflows for the new logs product that we are working on. This is documented in develop here: getsentry/sentry-docs#12395Note: The reason we have
buffer_overflow
as a separate item toqueue_overflow
is that in the future when we send log items in envelopes we'll incrementqueue_overflow
for the transport queue. We want to differentiate between the transport queue and the internal buffer explicitly.