Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/platforms/javascript/guides/angular/manual-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,12 @@ Open the page in a browser and click the button to trigger a frontend error and

</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />

</OnboardingOption>

### View Captured Data in Sentry

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).
Expand Down
6 changes: 6 additions & 0 deletions docs/platforms/javascript/guides/azure-functions/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ Deploy and trigger your function to start a child span.

</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />

</OnboardingOption>

### View Captured Data in Sentry

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).
Expand Down
6 changes: 6 additions & 0 deletions docs/platforms/javascript/guides/bun/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ Sentry.startSpan(

</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />

</OnboardingOption>

### View Captured Data in Sentry

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).
Expand Down
6 changes: 6 additions & 0 deletions docs/platforms/javascript/guides/capacitor/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,12 @@ Open the page in a browser and click the button to trigger a frontend error and

</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />

</OnboardingOption>

### View Captured Data in Sentry

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).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,12 @@ Open the `/sentry-test` route in your browser. You should start a trace and trig

</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />

</OnboardingOption>

### View Captured Data in Sentry

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).
Expand Down
10 changes: 9 additions & 1 deletion docs/platforms/javascript/guides/cloudflare/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Use this guide for general instructions on using the Sentry SDK with Cloudflare.
- **[SvelteKit](/platforms/javascript/guides/cloudflare/frameworks/sveltekit/)**

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

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

To use the Sentry SDK, add the `sentryPagesPlugin` as [middleware to your Cloudflare Pages application](https://developers.cloudflare.com/pages/functions/middleware/).

<Include name="cloudflare-pages-middleware-intro.mdx" />

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

</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />

</OnboardingOption>

### View Captured Data in Sentry

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).
Expand Down
6 changes: 6 additions & 0 deletions docs/platforms/javascript/guides/deno/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ Sentry.startSpan({
```
</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />

</OnboardingOption>

### View Captured Data in Sentry

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).
Expand Down
10 changes: 7 additions & 3 deletions docs/platforms/javascript/guides/electron/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ Sentry.init({
// Learn more at
// https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate
tracesSampleRate: 1.0,
integrations: [
Sentry.startupTracingIntegration(),
],
integrations: [Sentry.startupTracingIntegration()],
// ___PRODUCT_OPTION_END___ performance
// ___PRODUCT_OPTION_START___ logs

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

</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />

</OnboardingOption>

### View Captured Data in Sentry

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).
Expand Down
6 changes: 6 additions & 0 deletions docs/platforms/javascript/guides/ember/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ Open the page in a browser and click the button to trigger a frontend error and

</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />

</OnboardingOption>

### View Captured Data in Sentry

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).
Expand Down
34 changes: 17 additions & 17 deletions docs/platforms/javascript/guides/firebase/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,16 @@ exports.helloWorld = onRequest(async (request, response) => {
});

// Firestore trigger - automatically instrumented
exports.onUserCreated = onDocumentCreated(
"users/{userId}",
async (event) => {
const userId = event.params.userId;
// Your logic here
}
);
exports.onUserCreated = onDocumentCreated("users/{userId}", async (event) => {
const userId = event.params.userId;
// Your logic here
});
```

<Alert>
The key is to import the initialization file **before** any other `require` calls,
including Firebase imports. This ensures Sentry can properly instrument all
modules.
The key is to import the initialization file **before** any other `require`
calls, including Firebase imports. This ensures Sentry can properly instrument
all modules.
</Alert>

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

exports.tracedFunction = onRequest(async (request, response) => {
await Sentry.startSpan(
{ op: "task", name: "My Custom Task" },
async () => {
// Simulate some work
await new Promise((resolve) => setTimeout(resolve, 100));
}
);
await Sentry.startSpan({ op: "task", name: "My Custom Task" }, async () => {
// Simulate some work
await new Promise((resolve) => setTimeout(resolve, 100));
});

response.send("Done!");
});
```

</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />

</OnboardingOption>

### View Captured Data in Sentry

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).
Expand Down
6 changes: 6 additions & 0 deletions docs/platforms/javascript/guides/gatsby/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ Open the page in a browser and click the button to trigger a frontend error and

</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />

</OnboardingOption>

### View Captured Data in Sentry

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).
Expand Down
11 changes: 10 additions & 1 deletion docs/platforms/javascript/guides/gcp-functions/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ categories:
</Alert>

<Alert level="info" title="Using Cloud Functions for Firebase?">
If you're using [Cloud Functions for Firebase](https://firebase.google.com/docs/functions), see our dedicated [Firebase guide](/platforms/javascript/guides/firebase/) for a simpler setup using `@sentry/node`.
If you're using [Cloud Functions for
Firebase](https://firebase.google.com/docs/functions), see our dedicated
[Firebase guide](/platforms/javascript/guides/firebase/) for a simpler setup
using `@sentry/node`.
</Alert>

<PlatformContent includePath="getting-started-prerequisites" />
Expand Down Expand Up @@ -120,6 +123,12 @@ exports.helloEvent = Sentry.wrapCloudEventFunction(async (context) => {

</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />

</OnboardingOption>

### View Captured Data in Sentry

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).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,12 @@ Open the route in your browser. You should start a trace and trigger an error.

</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />

</OnboardingOption>

### View Captured Data in Sentry

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).
Expand Down
6 changes: 6 additions & 0 deletions docs/platforms/javascript/guides/solid/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ Open the page in a browser and click the button to trigger a frontend error and

</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />

</OnboardingOption>

### View Captured Data in Sentry

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).
Expand Down
6 changes: 6 additions & 0 deletions docs/platforms/javascript/guides/solidstart/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,12 @@ Open the page in the browser and click the button to trigger a frontend error, a

</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />

</OnboardingOption>

### View Captured Data in Sentry

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).
Expand Down
6 changes: 6 additions & 0 deletions docs/platforms/javascript/guides/svelte/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,12 @@ Open the page in a browser and click the button to trigger a frontend error and

</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />

</OnboardingOption>

<OnboardingOption>
### View Captured Data in Sentry

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,12 @@ Additionally, this starts a performance trace to measure the time it takes for t

</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />

</OnboardingOption>

### View Captured Data in Sentry

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).
Expand Down
6 changes: 6 additions & 0 deletions docs/platforms/javascript/guides/vue/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,12 @@ Open the page in a browser and click the button to trigger a frontend error and

</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />

</OnboardingOption>

### View Captured Data in Sentry

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).
Expand Down
6 changes: 6 additions & 0 deletions docs/platforms/javascript/guides/wasm/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ function testWasmTracing() {

</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />

</OnboardingOption>

### View Captured Data in Sentry

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).
Expand Down
16 changes: 8 additions & 8 deletions includes/logs/javascript-quick-start-verify-logs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
To verify that Sentry catches your logs, add some log statements to your application:

```javascript
Sentry.logger.info("User login successful", {
userId: "user_123",
loginMethod: "oauth",
});
Sentry.logger.info("User example action completed");

Sentry.logger.warn("API rate limit approaching", {
remaining: 25,
limit: 100,
Sentry.logger.warn("Slow operation detected", {
operation: "data_fetch",
duration: 3500,
});

Sentry.logger.error("Failed to process payment");
Sentry.logger.error("Validation failed", {
field: "email",
reason: "Invalid email",
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,12 @@ To test tracing, create a custom span to measure the time it takes for the API r

</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />

</OnboardingOption>

### View Captured Data in Sentry

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).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,12 @@ After running your project:

</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />

</OnboardingOption>

### View Captured Data in Sentry

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).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,12 @@ Open the page in a browser (for most Remix applications, this will be at localho

</OnboardingOption>

<OnboardingOption optionId="logs">

<Include name="logs/javascript-quick-start-verify-logs" />

</OnboardingOption>

<PlatformContent includePath="getting-started-browser-sandbox-warning" />

### View Captured Data in Sentry
Expand Down
Loading
Loading