GeezerVison is showing github.com — feat(node): Send client reports by lforst · Pull Request #12951 · getsentry/sentry-javascript
Conversation
lforst
commented
Jul 17, 2024
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Resolves #12822
This PR adds client reports to the Node.js SDK.
Client reports must be enabled via the startClientReportTracking() method on the NodeClient. This is due to the fact that client reports (or rather the setInterval that is required for periodically sending them) is acquiring a resource that needs cleanup. If somebody were to create clients over and over again, without calling client.close() they would be leaking memory.
If startClientReportTracking() is called, the client will flush all client reports
- every 60 seconds.
- on
process.on('beforeExit'), which is when the event loop has run out of things to do.
Out of the box, the Node.js SDK's Sentry.init() will call startClientReportTracking(), since there we can assume that users are using a singular client.
We are also introducing a new option for the Node.js SDK called clientReportFlushInterval that will control the flush interval of the periodic client report flushing.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
size-limit report 📦
| Path |
Size |
| @sentry/browser |
22.31 KB (+0.02% 🔺) |
| @sentry/browser (incl. Tracing) |
33.72 KB (+0.01% 🔺) |
| @sentry/browser (incl. Tracing, Replay) |
69.81 KB (+0.01% 🔺) |
| @sentry/browser (incl. Tracing, Replay) - with treeshaking flags |
63.15 KB (+0.07% 🔺) |
| @sentry/browser (incl. Tracing, Replay with Canvas) |
74.21 KB (+0.01% 🔺) |
| @sentry/browser (incl. Tracing, Replay, Feedback) |
86.52 KB (+0.01% 🔺) |
| @sentry/browser (incl. Tracing, Replay, Feedback, metrics) |
88.4 KB (+0.01% 🔺) |
| @sentry/browser (incl. metrics) |
26.62 KB (+0.02% 🔺) |
| @sentry/browser (incl. Feedback) |
38.98 KB (+0.02% 🔺) |
| @sentry/browser (incl. sendFeedback) |
26.93 KB (+0.03% 🔺) |
| @sentry/browser (incl. FeedbackAsync) |
31.54 KB (+0.02% 🔺) |
| @sentry/react |
25.08 KB (+0.07% 🔺) |
| @sentry/react (incl. Tracing) |
36.8 KB (+0.04% 🔺) |
| @sentry/vue |
26.45 KB (+0.03% 🔺) |
| @sentry/vue (incl. Tracing) |
35.61 KB (+0.05% 🔺) |
| @sentry/svelte |
22.44 KB (+0.03% 🔺) |
| CDN Bundle |
23.52 KB (0%) |
| CDN Bundle (incl. Tracing) |
35.5 KB (0%) |
| CDN Bundle (incl. Tracing, Replay) |
69.9 KB (-0.01% 🔽) |
| CDN Bundle (incl. Tracing, Replay, Feedback) |
75.17 KB (-0.01% 🔽) |
| CDN Bundle - uncompressed |
69 KB (0%) |
| CDN Bundle (incl. Tracing) - uncompressed |
105.1 KB (0%) |
| CDN Bundle (incl. Tracing, Replay) - uncompressed |
216.88 KB (0%) |
| CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed |
229.6 KB (0%) |
| @sentry/nextjs (client) |
36.66 KB (+0.04% 🔺) |
| @sentry/sveltekit (client) |
34.39 KB (+0.04% 🔺) |
| @sentry/node |
111.57 KB (+0.26% 🔺) |
| @sentry/node - without tracing |
89 KB (+0.33% 🔺) |
| @sentry/aws-serverless |
98.17 KB (+0.29% 🔺) |
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
mydea
mydea approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Implement client reports for Node
Uh oh!
There was an error while loading. Please reload this page.
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.
|