Support/make use of Async Hooks
See original GitHub issue- Review the documentation: https://docs.sentry.io/
- Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
- Use the latest release: https://github.com/getsentry/sentry-javascript/releases
- Provide a link to the affected event from your Sentry account
Package + Version
-
@sentry/browser
-
@sentry/node
-
raven-js
-
raven-node
(raven for node) - other:
Version:
6.5.1
Description
I’ve talked about this extensivly in https://github.com/getsentry/sentry-javascript/issues/2172. But since that issue seems to have stalled and others are also seeming to request this (see https://github.com/getsentry/sentry-javascript/issues/2817#issuecomment-756864140) I thought it would be nicer to open an official dedicated issue.
Why:
- Better and out of the box propper transactions and context handling.
- Should fix issues like breadcrumbs not being properly attached to the right error/transaction.
- Should fix issues of child spans not being correctly attached to the right transaction.
- Domains are deprecated and have performance and error handling issues.
- Domains don’t seem to actually properly work.
Some examples of agents who do use Async Hooks:
- googleapis/cloud-trace-nodejs
- I can personally confirm this one works out of the box and does tracing correctly
- honeycombio/beeline-nodejs
- elastic/apm-agent-nodejs
- https://github.com/DataDog/dd-trace-js/tree/master/packages/dd-trace
Atm I don’t see how one can use Sentry’s performance offering using Node without this being fixed (unless you only serve 1 request at the same time, which isn’t realistic). I hope I’m missing something since we do want to use your offering but don’t see a way of doing that at this time.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:16 (4 by maintainers)
Top Results From Across the Web
Async hooks | Node.js v19.3.0 Documentation
If Worker s are used, each thread has an independent async_hooks interface, and each thread will use a new set of async IDs....
Read more >Using Async Hooks for Request Context Handling in Node.js
Node.js Async Hooks provide an API to track the lifetime of asynchronous resources in a Node ... Let's use Async Hooks to track...
Read more >Asynchronous Processes (GNU Emacs Lisp Reference Manual)
Use the string name as the process name; if a process with this name already exists, then name is modified (by appending '...
Read more >Testing - Spring
The Spring team has found that the correct use of inversion of control (IoC) ... These base test classes provide well-defined hooks into...
Read more >@ice/store: Documentation | Openbase
Minimal & Familiar API: No additional learning costs, easy to get started with the knowledge of Redux && React Hooks. Built in Async...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For anyone else who ends up here hoping to find a way to make Sentry work with
async_hooks
, I posted a Gist showing how I made this work by usingAsyncLocalStorage
to create what are effectively thread-local hubs that can make this work better… https://gist.github.com/jasonk/a06153476ae7fad41c527e321e318088Any updates? There are 2022, Node.js 18 and no async_hooks in sentry 😦