Skip to content

Commit 5f69efe

Browse files
docs(js): Add logs to verify in all JS SDK quick start guides (#16656)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR Adds an include to JS SDK quick start guides to help users verify logging. Closes: #16321 ## 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) ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)
1 parent 128f3be commit 5f69efe

File tree

27 files changed

+184
-36
lines changed

27 files changed

+184
-36
lines changed

docs/platforms/javascript/guides/angular/manual-setup.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,12 @@ Open the page in a browser and click the button to trigger a frontend error and
404404

405405
</OnboardingOption>
406406

407+
<OnboardingOption optionId="logs">
408+
409+
<Include name="logs/javascript-quick-start-verify-logs" />
410+
411+
</OnboardingOption>
412+
407413
### View Captured Data in Sentry
408414

409415
Now, head over to your project on [Sentry.io](https://sentry.io/) to view the collected data (it takes a couple of moments for the data to appear).

docs/platforms/javascript/guides/azure-functions/index.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,12 @@ Deploy and trigger your function to start a child span.
163163

164164
</OnboardingOption>
165165

166+
<OnboardingOption optionId="logs">
167+
168+
<Include name="logs/javascript-quick-start-verify-logs" />
169+
170+
</OnboardingOption>
171+
166172
### View Captured Data in Sentry
167173

168174
Now, head over to your project on [Sentry.io](https://sentry.io/) to view the collected data (it takes a couple of moments for the data to appear).

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ Sentry.startSpan(
124124

125125
</OnboardingOption>
126126

127+
<OnboardingOption optionId="logs">
128+
129+
<Include name="logs/javascript-quick-start-verify-logs" />
130+
131+
</OnboardingOption>
132+
127133
### View Captured Data in Sentry
128134

129135
Finally, head over to your project on [Sentry.io](https://sentry.io/) to view the collected data (it takes a couple of moments for the data to appear).

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,12 @@ Open the page in a browser and click the button to trigger a frontend error and
250250

251251
</OnboardingOption>
252252

253+
<OnboardingOption optionId="logs">
254+
255+
<Include name="logs/javascript-quick-start-verify-logs" />
256+
257+
</OnboardingOption>
258+
253259
### View Captured Data in Sentry
254260

255261
Now, head over to your project on [Sentry.io](https://sentry.io/) to view the collected data (it takes a couple of moments for the data to appear).

docs/platforms/javascript/guides/cloudflare/frameworks/hydrogen-react-router.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,12 @@ Open the `/sentry-test` route in your browser. You should start a trace and trig
350350

351351
</OnboardingOption>
352352

353+
<OnboardingOption optionId="logs">
354+
355+
<Include name="logs/javascript-quick-start-verify-logs" />
356+
357+
</OnboardingOption>
358+
353359
### View Captured Data in Sentry
354360

355361
Now, head over to your project on [Sentry.io](https://sentry.io) to view the collected data (it takes a couple of moments for the data to appear).

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ Use this guide for general instructions on using the Sentry SDK with Cloudflare.
2020
- **[SvelteKit](/platforms/javascript/guides/cloudflare/frameworks/sveltekit/)**
2121

2222
<Alert>
23-
The Cloudflare Workers runtime has some platform-specific limitations that affect tracing. See [Known Limitations](#known-limitations) for details.
23+
The Cloudflare Workers runtime has some platform-specific limitations that
24+
affect tracing. See [Known Limitations](#known-limitations) for details.
2425
</Alert>
2526

2627
<PlatformContent includePath="getting-started-prerequisites" />
@@ -59,6 +60,7 @@ The main Sentry configuration should happen as early as possible in your app's l
5960
### Setup for Cloudflare Pages
6061

6162
To use the Sentry SDK, add the `sentryPagesPlugin` as [middleware to your Cloudflare Pages application](https://developers.cloudflare.com/pages/functions/middleware/).
63+
6264
<Include name="cloudflare-pages-middleware-intro.mdx" />
6365

6466
```javascript {filename:functions/_middleware.js}
@@ -201,6 +203,12 @@ export async function onRequest(context) {
201203

202204
</OnboardingOption>
203205

206+
<OnboardingOption optionId="logs">
207+
208+
<Include name="logs/javascript-quick-start-verify-logs" />
209+
210+
</OnboardingOption>
211+
204212
### View Captured Data in Sentry
205213

206214
Now, head over to your project on [Sentry.io](https://sentry.io) to view the collected data (it takes a couple of moments for the data to appear).

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ Sentry.startSpan({
126126
```
127127
</OnboardingOption>
128128

129+
<OnboardingOption optionId="logs">
130+
131+
<Include name="logs/javascript-quick-start-verify-logs" />
132+
133+
</OnboardingOption>
134+
129135
### View Captured Data in Sentry
130136

131137
Finally, head over to your project on [Sentry.io](https://sentry.io/) to view the collected data (it takes a couple of moments for the data to appear).

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ Sentry.init({
6262
// Learn more at
6363
// https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate
6464
tracesSampleRate: 1.0,
65-
integrations: [
66-
Sentry.startupTracingIntegration(),
67-
],
65+
integrations: [Sentry.startupTracingIntegration()],
6866
// ___PRODUCT_OPTION_END___ performance
6967
// ___PRODUCT_OPTION_START___ logs
7068

@@ -244,6 +242,12 @@ Start your app and trigger two errors that Sentry will capture: one from the mai
244242

245243
</OnboardingOption>
246244

245+
<OnboardingOption optionId="logs">
246+
247+
<Include name="logs/javascript-quick-start-verify-logs" />
248+
249+
</OnboardingOption>
250+
247251
### View Captured Data in Sentry
248252

249253
Now, head over to your project on [Sentry.io](https://sentry.io/) to view the collected data (it takes a couple of moments for the data to appear).

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,12 @@ Open the page in a browser and click the button to trigger a frontend error and
163163

164164
</OnboardingOption>
165165

166+
<OnboardingOption optionId="logs">
167+
168+
<Include name="logs/javascript-quick-start-verify-logs" />
169+
170+
</OnboardingOption>
171+
166172
### View Captured Data in Sentry
167173

168174
Now, head over to your project on [Sentry.io](https://sentry.io) to view the collected data (it takes a couple of moments for the data to appear).

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,16 @@ exports.helloWorld = onRequest(async (request, response) => {
103103
});
104104

105105
// Firestore trigger - automatically instrumented
106-
exports.onUserCreated = onDocumentCreated(
107-
"users/{userId}",
108-
async (event) => {
109-
const userId = event.params.userId;
110-
// Your logic here
111-
}
112-
);
106+
exports.onUserCreated = onDocumentCreated("users/{userId}", async (event) => {
107+
const userId = event.params.userId;
108+
// Your logic here
109+
});
113110
```
114111

115112
<Alert>
116-
The key is to import the initialization file **before** any other `require` calls,
117-
including Firebase imports. This ensures Sentry can properly instrument all
118-
modules.
113+
The key is to import the initialization file **before** any other `require`
114+
calls, including Firebase imports. This ensures Sentry can properly instrument
115+
all modules.
119116
</Alert>
120117

121118
## Step 3: Add Readable Stack Traces With Source Maps (Optional)
@@ -158,20 +155,23 @@ const Sentry = require("@sentry/node");
158155
const { onRequest } = require("firebase-functions/https");
159156

160157
exports.tracedFunction = onRequest(async (request, response) => {
161-
await Sentry.startSpan(
162-
{ op: "task", name: "My Custom Task" },
163-
async () => {
164-
// Simulate some work
165-
await new Promise((resolve) => setTimeout(resolve, 100));
166-
}
167-
);
158+
await Sentry.startSpan({ op: "task", name: "My Custom Task" }, async () => {
159+
// Simulate some work
160+
await new Promise((resolve) => setTimeout(resolve, 100));
161+
});
168162

169163
response.send("Done!");
170164
});
171165
```
172166

173167
</OnboardingOption>
174168

169+
<OnboardingOption optionId="logs">
170+
171+
<Include name="logs/javascript-quick-start-verify-logs" />
172+
173+
</OnboardingOption>
174+
175175
### View Captured Data in Sentry
176176

177177
Now, head over to your project on [Sentry.io](https://sentry.io/) to view the collected data (it takes a couple of moments for the data to appear).

0 commit comments

Comments
 (0)