From 58b769ce5dfd87aabf8214195b939a72d6739f9a Mon Sep 17 00:00:00 2001 From: Sarah Mischinger Date: Tue, 8 Jul 2025 13:38:17 +0200 Subject: [PATCH 1/3] review and update Connect Quick Start guide --- .../javascript/guides/connect/index.mdx | 6 +---- .../javascript.node.mdx | 3 +++ .../javascript.connect.mdx | 26 +++++++++++++++++++ 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/docs/platforms/javascript/guides/connect/index.mdx b/docs/platforms/javascript/guides/connect/index.mdx index 6940442cb0582..b7a04aa9d09e1 100644 --- a/docs/platforms/javascript/guides/connect/index.mdx +++ b/docs/platforms/javascript/guides/connect/index.mdx @@ -1,6 +1,6 @@ --- title: Connect -description: "Learn about using Sentry with Connect." +description: "Learn how to manually set up Sentry in your Connect app and capture your first errors." sdk: sentry.javascript.node fallbackGuide: javascript.node categories: @@ -9,8 +9,4 @@ categories: - server-node --- - - -This guide explains how to set up Sentry in your Connect application. - diff --git a/platform-includes/getting-started-features-expandable/javascript.node.mdx b/platform-includes/getting-started-features-expandable/javascript.node.mdx index af2368dbab320..a728d1e44466b 100644 --- a/platform-includes/getting-started-features-expandable/javascript.node.mdx +++ b/platform-includes/getting-started-features-expandable/javascript.node.mdx @@ -7,5 +7,8 @@ impact of errors across multiple systems. For example, distributed tracing allows you to follow a request from the frontend to the backend and back. - [**Profiling**](/product/explore/profiling/): Gain deeper insight than traditional tracing without custom instrumentation, letting you discover slow-to-execute or resource-intensive functions in your app. +- [**Logs**](/product/explore/logs): Centralize and analyze your application logs to + correlate them with errors and performance issues. Search, filter, and + visualize log data to understand what's happening in your applications. diff --git a/platform-includes/getting-started-verify/javascript.connect.mdx b/platform-includes/getting-started-verify/javascript.connect.mdx index 5570cdb35cb33..4d7ef30472943 100644 --- a/platform-includes/getting-started-verify/javascript.connect.mdx +++ b/platform-includes/getting-started-verify/javascript.connect.mdx @@ -1,5 +1,31 @@ +First, let's make sure Sentry is correctly capturing errors and creating issues in your project. Add the following code snippet to your main application file; it defines a route that will deliberately trigger an error when called: + ```javascript app.get("/debug-sentry", function mainHandler(req, res) { throw new Error("My first Sentry error!"); }); ``` + + + +### 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: + +```javascript +app.use("/debug-sentry", async (req, res, next) => { + await Sentry.startSpan( + { + op: "test", + name: "My First Test Transaction", + }, + async () => { + await new Promise((resolve) => setTimeout(resolve, 100)); + throw new Error("My first Sentry error!"); + } + ); + } +}); +``` + + From 52ff9421ef4b4cead3e7d949e6b2b624ee7df330 Mon Sep 17 00:00:00 2001 From: Sarah Mischinger Date: Tue, 8 Jul 2025 14:27:35 +0200 Subject: [PATCH 2/3] update test code snippets --- .../getting-started-verify/javascript.connect.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform-includes/getting-started-verify/javascript.connect.mdx b/platform-includes/getting-started-verify/javascript.connect.mdx index 4d7ef30472943..8494b8cce779a 100644 --- a/platform-includes/getting-started-verify/javascript.connect.mdx +++ b/platform-includes/getting-started-verify/javascript.connect.mdx @@ -1,8 +1,8 @@ First, let's make sure Sentry is correctly capturing errors and creating issues in your project. Add the following code snippet to your main application file; it defines a route that will deliberately trigger an error when called: ```javascript -app.get("/debug-sentry", function mainHandler(req, res) { - throw new Error("My first Sentry error!"); +app.use("/debug-sentry", (req, res, next) => { + next(new Error("My first Sentry error!")); }); ``` @@ -21,7 +21,7 @@ app.use("/debug-sentry", async (req, res, next) => { }, async () => { await new Promise((resolve) => setTimeout(resolve, 100)); - throw new Error("My first Sentry error!"); + next(new Error("My first Sentry error!")); } ); } From 306926adb31c152d69821ac21effb37f96d529a4 Mon Sep 17 00:00:00 2001 From: Sarah Mischinger Date: Thu, 10 Jul 2025 07:22:36 +0200 Subject: [PATCH 3/3] Update platform-includes/getting-started-verify/javascript.connect.mdx Co-authored-by: Alex Krawiec --- platform-includes/getting-started-verify/javascript.connect.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-includes/getting-started-verify/javascript.connect.mdx b/platform-includes/getting-started-verify/javascript.connect.mdx index 8494b8cce779a..eb47b1f97abc0 100644 --- a/platform-includes/getting-started-verify/javascript.connect.mdx +++ b/platform-includes/getting-started-verify/javascript.connect.mdx @@ -10,7 +10,7 @@ app.use("/debug-sentry", (req, res, next) => { ### 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: +To test your tracing configuration, update the previous code snippet by starting a trace to measure the time it takes to execute your code: ```javascript app.use("/debug-sentry", async (req, res, next) => {