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

feat(node): Add breadcrumbs for child_process and worker_thread #13896

Merged
merged 8 commits into from
Oct 29, 2024

Conversation

timfish
Copy link
Collaborator

@timfish timfish commented Oct 7, 2024

I saw these were available in diagnostics_channel so this PR adds a default integration that includes breadcrumbs for both child process and worker thread start, stop and error.

Copy link
Contributor

github-actions bot commented Oct 7, 2024

size-limit report 📦

Path Size % Change Change
@sentry/browser 22.73 KB - -
@sentry/browser - with treeshaking flags 21.53 KB - -
@sentry/browser (incl. Tracing) 35.12 KB - -
@sentry/browser (incl. Tracing, Replay) 71.86 KB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 62.26 KB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 76.21 KB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 88.99 KB - -
@sentry/browser (incl. Tracing, Replay, Feedback, metrics) 90.82 KB - -
@sentry/browser (incl. metrics) 27 KB - -
@sentry/browser (incl. Feedback) 39.87 KB - -
@sentry/browser (incl. sendFeedback) 27.38 KB - -
@sentry/browser (incl. FeedbackAsync) 32.17 KB - -
@sentry/react 25.49 KB - -
@sentry/react (incl. Tracing) 38.09 KB - -
@sentry/vue 26.91 KB - -
@sentry/vue (incl. Tracing) 37.02 KB - -
@sentry/svelte 22.87 KB - -
CDN Bundle 24.11 KB - -
CDN Bundle (incl. Tracing) 36.96 KB - -
CDN Bundle (incl. Tracing, Replay) 71.65 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 76.99 KB - -
CDN Bundle - uncompressed 70.7 KB - -
CDN Bundle (incl. Tracing) - uncompressed 109.73 KB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 222.24 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 235.46 KB - -
@sentry/nextjs (client) 38.06 KB - -
@sentry/sveltekit (client) 35.74 KB - -
@sentry/node 125.45 KB +0.24% +305 B 🔺
@sentry/node - without tracing 94.54 KB +0.3% +289 B 🔺
@sentry/aws-serverless 104.07 KB +0.25% +263 B 🔺

View base workflow run

@AbhiPrasad AbhiPrasad self-requested a review October 9, 2024 00:55
@timfish timfish self-assigned this Oct 17, 2024
@lforst lforst self-requested a review October 21, 2024 13:16
@lforst
Copy link
Member

lforst commented Oct 22, 2024

Sorry for letting this one slip a bit. I have a concern with the value behind the individual things we log. Right now it seems we do:

  • child/worker spawned
  • child/worker exited

If I put myself into the seat of a user that looks at an error in Sentry, I don't think I care to much when a worker/child is created. I mostly care about whether I receive some faulty messages from a worker (I don't think we can instrument this reliably), or whether a child/worker dies unexpectedly.

What do you think about limiting the created breadcrumbs to error exits of children only?

@timfish
Copy link
Collaborator Author

timfish commented Oct 22, 2024

I mostly care about whether I receive some faulty messages from a worker (I don't think we can instrument this reliably)

Both Worker and ChildProcess are EventEmitters, so we could use the 'newListener' event to wrap users 'message' handlers and add things like tracing or to add some more context if their handler functions throw.

What do you think about limiting the created breadcrumbs to error exits of children only?

Yep makes sense, I'll change this!

@lforst
Copy link
Member

lforst commented Oct 22, 2024

I mostly care about whether I receive some faulty messages from a worker (I don't think we can instrument this reliably)

Both Worker and ChildProcess are EventEmitters, so we could use the 'newListener' event to wrap users 'message' handlers and add things like tracing or to add some more context if their handler functions throw.

Ah that's good to know. I still have concerns with how spammy this potentially gets so let's keep this in our head in case we want to instrument it in the future. Or maybe we can make it optional 🤔

@timfish
Copy link
Collaborator Author

timfish commented Oct 22, 2024

Or maybe we can make it optional

We can also just add it later in another PR!

I guess we already do something similar in browserApiErrorsIntegration to wrap setTimeout, setInterval, etc? Why is that browser only and not needed in Node?

@lforst lforst merged commit d396241 into develop Oct 29, 2024
144 checks passed
@lforst lforst deleted the timfish/feat/process-worker-thread-breadcrumbs branch October 29, 2024 09:11
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.

2 participants