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..8494b8cce779a 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!"); +app.use("/debug-sentry", (req, res, next) => { + next(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)); + next(new Error("My first Sentry error!")); + } + ); + } +}); +``` + +