diff --git a/docs/platforms/javascript/guides/angular/manual-setup.mdx b/docs/platforms/javascript/guides/angular/manual-setup.mdx index e79b1054c393d..e26fcc61d13e3 100644 --- a/docs/platforms/javascript/guides/angular/manual-setup.mdx +++ b/docs/platforms/javascript/guides/angular/manual-setup.mdx @@ -404,6 +404,12 @@ Open the page in a browser and click the button to trigger a frontend error and + + + + + + ### 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). diff --git a/docs/platforms/javascript/guides/azure-functions/index.mdx b/docs/platforms/javascript/guides/azure-functions/index.mdx index 31ccdf7c9732f..8aa7e62e94c78 100644 --- a/docs/platforms/javascript/guides/azure-functions/index.mdx +++ b/docs/platforms/javascript/guides/azure-functions/index.mdx @@ -163,6 +163,12 @@ Deploy and trigger your function to start a child span. + + + + + + ### 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). diff --git a/docs/platforms/javascript/guides/bun/index.mdx b/docs/platforms/javascript/guides/bun/index.mdx index 4459845808df7..7829ca4f6e412 100644 --- a/docs/platforms/javascript/guides/bun/index.mdx +++ b/docs/platforms/javascript/guides/bun/index.mdx @@ -124,6 +124,12 @@ Sentry.startSpan( + + + + + + ### 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). diff --git a/docs/platforms/javascript/guides/capacitor/index.mdx b/docs/platforms/javascript/guides/capacitor/index.mdx index 45e1dc6c79363..8045dd63039b1 100644 --- a/docs/platforms/javascript/guides/capacitor/index.mdx +++ b/docs/platforms/javascript/guides/capacitor/index.mdx @@ -250,6 +250,12 @@ Open the page in a browser and click the button to trigger a frontend error and + + + + + + ### 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). diff --git a/docs/platforms/javascript/guides/cloudflare/frameworks/hydrogen-react-router.mdx b/docs/platforms/javascript/guides/cloudflare/frameworks/hydrogen-react-router.mdx index 090bb53e88d86..534beca39954c 100644 --- a/docs/platforms/javascript/guides/cloudflare/frameworks/hydrogen-react-router.mdx +++ b/docs/platforms/javascript/guides/cloudflare/frameworks/hydrogen-react-router.mdx @@ -350,6 +350,12 @@ Open the `/sentry-test` route in your browser. You should start a trace and trig + + + + + + ### 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). diff --git a/docs/platforms/javascript/guides/cloudflare/index.mdx b/docs/platforms/javascript/guides/cloudflare/index.mdx index a07ef31f5753e..01e8df9a36dc5 100644 --- a/docs/platforms/javascript/guides/cloudflare/index.mdx +++ b/docs/platforms/javascript/guides/cloudflare/index.mdx @@ -20,7 +20,8 @@ Use this guide for general instructions on using the Sentry SDK with Cloudflare. - **[SvelteKit](/platforms/javascript/guides/cloudflare/frameworks/sveltekit/)** - 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. @@ -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/). + ```javascript {filename:functions/_middleware.js} @@ -201,6 +203,12 @@ export async function onRequest(context) { + + + + + + ### 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). diff --git a/docs/platforms/javascript/guides/deno/index.mdx b/docs/platforms/javascript/guides/deno/index.mdx index 80fbd940a5aa5..6976988e763f0 100644 --- a/docs/platforms/javascript/guides/deno/index.mdx +++ b/docs/platforms/javascript/guides/deno/index.mdx @@ -126,6 +126,12 @@ Sentry.startSpan({ ``` + + + + + + ### 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). diff --git a/docs/platforms/javascript/guides/electron/index.mdx b/docs/platforms/javascript/guides/electron/index.mdx index 188f2aff4c67b..9a7498e4ea236 100644 --- a/docs/platforms/javascript/guides/electron/index.mdx +++ b/docs/platforms/javascript/guides/electron/index.mdx @@ -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 @@ -244,6 +242,12 @@ Start your app and trigger two errors that Sentry will capture: one from the mai + + + + + + ### 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). diff --git a/docs/platforms/javascript/guides/ember/index.mdx b/docs/platforms/javascript/guides/ember/index.mdx index 079522d16fd8b..4d4d61e9a6fb1 100644 --- a/docs/platforms/javascript/guides/ember/index.mdx +++ b/docs/platforms/javascript/guides/ember/index.mdx @@ -163,6 +163,12 @@ Open the page in a browser and click the button to trigger a frontend error and + + + + + + ### 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). diff --git a/docs/platforms/javascript/guides/firebase/index.mdx b/docs/platforms/javascript/guides/firebase/index.mdx index caf9f38d480b9..c56bf0719647d 100644 --- a/docs/platforms/javascript/guides/firebase/index.mdx +++ b/docs/platforms/javascript/guides/firebase/index.mdx @@ -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 +}); ``` - 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. ## Step 3: Add Readable Stack Traces With Source Maps (Optional) @@ -158,13 +155,10 @@ 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!"); }); @@ -172,6 +166,12 @@ exports.tracedFunction = onRequest(async (request, response) => { + + + + + + ### 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). diff --git a/docs/platforms/javascript/guides/gatsby/index.mdx b/docs/platforms/javascript/guides/gatsby/index.mdx index 4682ffd85df08..2fdc357a800b4 100644 --- a/docs/platforms/javascript/guides/gatsby/index.mdx +++ b/docs/platforms/javascript/guides/gatsby/index.mdx @@ -186,6 +186,12 @@ Open the page in a browser and click the button to trigger a frontend error and + + + + + + ### 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). diff --git a/docs/platforms/javascript/guides/gcp-functions/index.mdx b/docs/platforms/javascript/guides/gcp-functions/index.mdx index fb63c7359fc70..77dc7aa54be8d 100644 --- a/docs/platforms/javascript/guides/gcp-functions/index.mdx +++ b/docs/platforms/javascript/guides/gcp-functions/index.mdx @@ -15,7 +15,10 @@ categories: - 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`. @@ -120,6 +123,12 @@ exports.helloEvent = Sentry.wrapCloudEventFunction(async (context) => { + + + + + + ### 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). diff --git a/docs/platforms/javascript/guides/react-router/manual-setup.mdx b/docs/platforms/javascript/guides/react-router/manual-setup.mdx index cbdfb61021963..799694929c321 100644 --- a/docs/platforms/javascript/guides/react-router/manual-setup.mdx +++ b/docs/platforms/javascript/guides/react-router/manual-setup.mdx @@ -555,6 +555,12 @@ Open the route in your browser. You should start a trace and trigger an error. + + + + + + ### 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). diff --git a/docs/platforms/javascript/guides/solid/index.mdx b/docs/platforms/javascript/guides/solid/index.mdx index 5d09b87b95f5f..7e2f7607c5107 100644 --- a/docs/platforms/javascript/guides/solid/index.mdx +++ b/docs/platforms/javascript/guides/solid/index.mdx @@ -180,6 +180,12 @@ Open the page in a browser and click the button to trigger a frontend error and + + + + + + ### 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). diff --git a/docs/platforms/javascript/guides/solidstart/index.mdx b/docs/platforms/javascript/guides/solidstart/index.mdx index 4a5102cb757c9..8fbef30f0787f 100644 --- a/docs/platforms/javascript/guides/solidstart/index.mdx +++ b/docs/platforms/javascript/guides/solidstart/index.mdx @@ -358,6 +358,12 @@ Open the page in the browser and click the button to trigger a frontend error, a + + + + + + ### 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). diff --git a/docs/platforms/javascript/guides/svelte/index.mdx b/docs/platforms/javascript/guides/svelte/index.mdx index 53487083ddb3c..af518781ba951 100644 --- a/docs/platforms/javascript/guides/svelte/index.mdx +++ b/docs/platforms/javascript/guides/svelte/index.mdx @@ -270,6 +270,12 @@ Open the page in a browser and click the button to trigger a frontend error and + + + + + + ### View Captured Data in Sentry diff --git a/docs/platforms/javascript/guides/tanstackstart-react/index.mdx b/docs/platforms/javascript/guides/tanstackstart-react/index.mdx index d76f1067c9fd1..b710e5821ec89 100644 --- a/docs/platforms/javascript/guides/tanstackstart-react/index.mdx +++ b/docs/platforms/javascript/guides/tanstackstart-react/index.mdx @@ -433,6 +433,12 @@ Additionally, this starts a performance trace to measure the time it takes for t + + + + + + ### 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). diff --git a/docs/platforms/javascript/guides/vue/index.mdx b/docs/platforms/javascript/guides/vue/index.mdx index 6540aca0262a5..bc62cca30cf78 100644 --- a/docs/platforms/javascript/guides/vue/index.mdx +++ b/docs/platforms/javascript/guides/vue/index.mdx @@ -286,6 +286,12 @@ Open the page in a browser and click the button to trigger a frontend error and + + + + + + ### 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). diff --git a/docs/platforms/javascript/guides/wasm/index.mdx b/docs/platforms/javascript/guides/wasm/index.mdx index 8afbd943711aa..edd06a8484f6f 100644 --- a/docs/platforms/javascript/guides/wasm/index.mdx +++ b/docs/platforms/javascript/guides/wasm/index.mdx @@ -183,6 +183,12 @@ function testWasmTracing() { + + + + + + ### 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). diff --git a/includes/logs/javascript-quick-start-verify-logs.mdx b/includes/logs/javascript-quick-start-verify-logs.mdx index 0853737f85ecb..738d92c83ff28 100644 --- a/includes/logs/javascript-quick-start-verify-logs.mdx +++ b/includes/logs/javascript-quick-start-verify-logs.mdx @@ -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", +}); ``` diff --git a/platform-includes/getting-started-complete/javascript.astro.mdx b/platform-includes/getting-started-complete/javascript.astro.mdx index fa796a4a2d7ca..b98796af7a818 100644 --- a/platform-includes/getting-started-complete/javascript.astro.mdx +++ b/platform-includes/getting-started-complete/javascript.astro.mdx @@ -388,6 +388,12 @@ To test tracing, create a custom span to measure the time it takes for the API r + + + + + + ### 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). diff --git a/platform-includes/getting-started-complete/javascript.nuxt.mdx b/platform-includes/getting-started-complete/javascript.nuxt.mdx index 01be5fe060b2e..adb312e62cdaa 100644 --- a/platform-includes/getting-started-complete/javascript.nuxt.mdx +++ b/platform-includes/getting-started-complete/javascript.nuxt.mdx @@ -356,6 +356,12 @@ After running your project: + + + + + + ### 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). diff --git a/platform-includes/getting-started-complete/javascript.remix.mdx b/platform-includes/getting-started-complete/javascript.remix.mdx index 8ddeca706bce3..de613f50eebe2 100644 --- a/platform-includes/getting-started-complete/javascript.remix.mdx +++ b/platform-includes/getting-started-complete/javascript.remix.mdx @@ -446,6 +446,12 @@ Open the page in a browser (for most Remix applications, this will be at localho + + + + + + ### View Captured Data in Sentry diff --git a/platform-includes/getting-started-complete/javascript.sveltekit.mdx b/platform-includes/getting-started-complete/javascript.sveltekit.mdx index 38e87bbe37813..9088503457f04 100644 --- a/platform-includes/getting-started-complete/javascript.sveltekit.mdx +++ b/platform-includes/getting-started-complete/javascript.sveltekit.mdx @@ -9,12 +9,12 @@ You need: -Version `2.31.0` of SvelteKit introduces [official support for observability and tracing](https://svelte.dev/docs/kit/observability). +Version `2.31.0` of SvelteKit introduces [official support for observability and tracing](https://svelte.dev/docs/kit/observability). This means that Sentry can now follow the official best practice for how the SDK should be set up: -- The Sentry SDK will be initialized at the correct, earliest possible time on the server, allowing for all its auto-instrumentation to work correctly. - This means, you will now get spans from auto instrumentation (e.g. database queries) automatically. -- The Sentry SDK picks up spans emitted from SvelteKit directly. +- The Sentry SDK will be initialized at the correct, earliest possible time on the server, allowing for all its auto-instrumentation to work correctly. + This means, you will now get spans from auto instrumentation (e.g. database queries) automatically. +- The Sentry SDK picks up spans emitted from SvelteKit directly. You'll get more accurate insights into the performance of your handlers, server actions, `load`, and remote functions. SvelteKit observability is still an experimental feature in SvelteKit 2.x, but we recommend giving it a try. @@ -22,8 +22,8 @@ The Sentry wizard, as well as this guide, will use it as the default way of sett -If you've already set up the SDK and don't want to migrate to the new setup, or don't want to upgrade to SvelteKit `2.31.0` or higher, that's fine too. -Just follow this guide instead. +If you've already set up the SDK and don't want to migrate to the new setup, or don't want to upgrade to SvelteKit `2.31.0` or higher, that's fine too. +Just follow this guide instead. However, note that auto instrumentation (e.g. for database queries) will not work. @@ -447,6 +447,12 @@ Additionally, this starts a trace to measure the time it takes for the API reque + + + + + + ### 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). diff --git a/platform-includes/getting-started-verify/javascript.hono.mdx b/platform-includes/getting-started-verify/javascript.hono.mdx index a3cc0f623ba73..ccccc37f01263 100644 --- a/platform-includes/getting-started-verify/javascript.hono.mdx +++ b/platform-includes/getting-started-verify/javascript.hono.mdx @@ -30,3 +30,9 @@ app.get("/debug-sentry", async () => { ``` + + + + + + diff --git a/platform-includes/getting-started-verify/javascript.koa.mdx b/platform-includes/getting-started-verify/javascript.koa.mdx index b40d2160e620b..e3f412bc340d7 100644 --- a/platform-includes/getting-started-verify/javascript.koa.mdx +++ b/platform-includes/getting-started-verify/javascript.koa.mdx @@ -9,6 +9,7 @@ router.get("/debug-sentry", function () { ``` +### Tracing To test your tracing configuration, update the previous code snippet by starting a trace to measure the time it takes for the execution of your code: diff --git a/platform-includes/getting-started-verify/javascript.mdx b/platform-includes/getting-started-verify/javascript.mdx index 10e981a36271b..fb6115f8f53a3 100644 --- a/platform-includes/getting-started-verify/javascript.mdx +++ b/platform-includes/getting-started-verify/javascript.mdx @@ -44,3 +44,9 @@ To test your tracing configuration, update the previous code to simulate a longe Open the page in a browser and click the button to throw an error and create a trace. + + + + + +