Skip to content

Commit 4b4614f

Browse files
Update docs with Sentry initialization callout (#14391)
``` <!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR This PR updates the Node.js and Bun JavaScript guides to make the `instrument.js` import timing more prominent. The previous introductory paragraph in the "Apply Instrumentation to Your App" (Node.js) and "Use" (Bun) sections has been replaced with a yellow warning callout. This change ensures that users are clearly informed about the importance of initializing Sentry early to prevent issues with auto-instrumentation, database monitoring, agent monitoring, and tracing. **Affected pages:** - https://docs.sentry.io/platforms/javascript/guides/node/#apply-instrumentation-to-your-app - https://docs.sentry.io/platforms/javascript/guides/bun/#use **New text in callout:** > Import `instrument.js` before any other modules to ensure Sentry initializes early. If you initialize later, auto-instrumentation and modules like database monitoring, agent monitoring, tracing may not work. ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [x] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## LEGAL BOILERPLATE <!-- Sentry employees and contractors can delete or ignore this section. --> Look, I get it Co-authored-by: Cursor Agent <[email protected]>
1 parent 724817a commit 4b4614f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

docs/platforms/javascript/guides/bun/index.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ You can also manually capture performance data - see <PlatformLink to="/tracing/
6464

6565
## Use
6666

67-
You need to import the `instrument.js` file before importing any other modules in your application. This is necessary to ensure that Sentry can automatically instrument all modules in your application:
67+
<Alert level='warning'>
68+
69+
Import `instrument.js` before any other modules to ensure Sentry initializes early. If you initialize later, auto-instrumentation and modules like database monitoring, agent monitoring, tracing may not work.
70+
71+
</Alert>
6872

6973
```javascript {filename: app.js}
7074
// Import this first!

platform-includes/getting-started-node/javascript.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ To import and initialize Sentry, create a file named `instrument.(js|mjs)` in th
2626

2727
### Apply Instrumentation to Your App
2828

29-
Make sure to initialize Sentry before you require or import any other modules in your app. Otherwise, auto-instrumentation won't work for these modules.
29+
<Alert level='warning'>
30+
31+
Import `instrument.js` before any other modules to ensure Sentry initializes early. If you initialize later, auto-instrumentation and modules like database monitoring, agent monitoring, tracing may not work.
32+
33+
</Alert>
3034

3135
<Alert level="info" title="Which module system are you using?">
3236

0 commit comments

Comments
 (0)