From c229f3fcf14e25a90338f973fbf191fb1bd376a3 Mon Sep 17 00:00:00 2001 From: Sarah Mischinger Date: Thu, 3 Jul 2025 08:43:53 +0200 Subject: [PATCH 1/5] update fastify description --- docs/platforms/javascript/guides/fastify/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/javascript/guides/fastify/index.mdx b/docs/platforms/javascript/guides/fastify/index.mdx index 5c939e0d913a2..a31ff6b89b7f8 100644 --- a/docs/platforms/javascript/guides/fastify/index.mdx +++ b/docs/platforms/javascript/guides/fastify/index.mdx @@ -1,6 +1,6 @@ --- title: Fastify -description: "This guide explains how to set up Sentry in your Fastify application." +description: "Learn how to manually set up Sentry in your Fastify app and capture your first errors." sdk: sentry.javascript.node fallbackGuide: javascript.node categories: From eecc4be59621a4d37e8022a117e69e12ecd2d177 Mon Sep 17 00:00:00 2001 From: Sarah Mischinger Date: Thu, 3 Jul 2025 09:23:35 +0200 Subject: [PATCH 2/5] review and update Fastify quick start guide --- .../javascript.fastify.mdx | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/platform-includes/getting-started-verify/javascript.fastify.mdx b/platform-includes/getting-started-verify/javascript.fastify.mdx index 5570cdb35cb33..52e15105c672b 100644 --- a/platform-includes/getting-started-verify/javascript.fastify.mdx +++ b/platform-includes/getting-started-verify/javascript.fastify.mdx @@ -1,5 +1,32 @@ +### Issues + +First, let's verify that Sentry captures errors and creates issues in your Sentry project. Add the following code snippet to your main application file that defines a route that triggers 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.get("/debug-sentry", async function mainHandler(request, reply) { + await Sentry.startSpan( + { + op: "test", + name: "My First Test Transaction", + }, + async () => { + await new Promise((resolve) => setTimeout(resolve, 100)); // Wait for 100ms + throw new Error("My first Sentry error!"); + } + ); +}); +``` + + From 114a83925e10d3edb11c34f98a13b87c209a6e88 Mon Sep 17 00:00:00 2001 From: Sarah Mischinger Date: Tue, 8 Jul 2025 13:41:30 +0200 Subject: [PATCH 3/5] update tracing test code snippet --- platform-includes/getting-started-verify/javascript.fastify.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-includes/getting-started-verify/javascript.fastify.mdx b/platform-includes/getting-started-verify/javascript.fastify.mdx index 52e15105c672b..b780c649bee57 100644 --- a/platform-includes/getting-started-verify/javascript.fastify.mdx +++ b/platform-includes/getting-started-verify/javascript.fastify.mdx @@ -15,7 +15,7 @@ app.get("/debug-sentry", function mainHandler(req, res) { 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.get("/debug-sentry", async function mainHandler(request, reply) { +app.get("/debug-sentry", async (request, reply) { await Sentry.startSpan( { op: "test", From abe6ca54418fe86c5f8167afd3e99900564eeb22 Mon Sep 17 00:00:00 2001 From: Sarah Mischinger Date: Tue, 8 Jul 2025 13:44:26 +0200 Subject: [PATCH 4/5] fix tracing test code snippet --- platform-includes/getting-started-verify/javascript.fastify.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-includes/getting-started-verify/javascript.fastify.mdx b/platform-includes/getting-started-verify/javascript.fastify.mdx index b780c649bee57..e274cadc91c60 100644 --- a/platform-includes/getting-started-verify/javascript.fastify.mdx +++ b/platform-includes/getting-started-verify/javascript.fastify.mdx @@ -15,7 +15,7 @@ app.get("/debug-sentry", function mainHandler(req, res) { 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.get("/debug-sentry", async (request, reply) { +app.get("/debug-sentry", async (request, reply) => { await Sentry.startSpan( { op: "test", From 61f7518cba701a1f4b16dc2e94db53004b32435e Mon Sep 17 00:00:00 2001 From: Sarah Mischinger Date: Tue, 8 Jul 2025 14:06:05 +0200 Subject: [PATCH 5/5] update wording --- platform-includes/getting-started-verify/javascript.fastify.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-includes/getting-started-verify/javascript.fastify.mdx b/platform-includes/getting-started-verify/javascript.fastify.mdx index e274cadc91c60..6030ed25cfa21 100644 --- a/platform-includes/getting-started-verify/javascript.fastify.mdx +++ b/platform-includes/getting-started-verify/javascript.fastify.mdx @@ -1,6 +1,6 @@ ### Issues -First, let's verify that Sentry captures errors and creates issues in your Sentry project. Add the following code snippet to your main application file that defines a route that triggers an error when called: +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) {