From f61cfcf32640d48acaf592d122a0875817d26123 Mon Sep 17 00:00:00 2001 From: Sarah Mischinger Date: Thu, 3 Jul 2025 09:45:02 +0200 Subject: [PATCH 1/4] review and update Koa quick start guide --- .../platforms/javascript/guides/koa/index.mdx | 6 +---- .../getting-started-verify/javascript.koa.mdx | 27 ++++++++++++++++++- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/docs/platforms/javascript/guides/koa/index.mdx b/docs/platforms/javascript/guides/koa/index.mdx index ed61e821dd2d3f..cb922bbeee92c0 100644 --- a/docs/platforms/javascript/guides/koa/index.mdx +++ b/docs/platforms/javascript/guides/koa/index.mdx @@ -1,6 +1,6 @@ --- title: Koa -description: "Learn about using Sentry with Koa." +description: "This guide explains how to set up Sentry in your Koa application." 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 Koa application. - diff --git a/platform-includes/getting-started-verify/javascript.koa.mdx b/platform-includes/getting-started-verify/javascript.koa.mdx index a17473f4be0dbc..550544f1a06ea5 100644 --- a/platform-includes/getting-started-verify/javascript.koa.mdx +++ b/platform-includes/getting-started-verify/javascript.koa.mdx @@ -1,5 +1,30 @@ +### 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 -router.get("/debug-sentry", function() { +router.get("/debug-sentry", function () { throw new Error("My first Sentry error!"); }); ``` + + + +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 +router.get("/debug-sentry", async function (ctx) { + 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 18a80e9f7b4ec2373512777b23f318a7c26df5c0 Mon Sep 17 00:00:00 2001 From: Sarah Mischinger Date: Tue, 8 Jul 2025 13:43:35 +0200 Subject: [PATCH 2/4] update tracing test code snippet --- platform-includes/getting-started-verify/javascript.koa.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-includes/getting-started-verify/javascript.koa.mdx b/platform-includes/getting-started-verify/javascript.koa.mdx index 550544f1a06ea5..1d1d16a9f512fc 100644 --- a/platform-includes/getting-started-verify/javascript.koa.mdx +++ b/platform-includes/getting-started-verify/javascript.koa.mdx @@ -13,7 +13,7 @@ router.get("/debug-sentry", function () { 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 -router.get("/debug-sentry", async function (ctx) { +router.get("/debug-sentry", async (ctx) => { await Sentry.startSpan( { op: "test", From 179d4b7e18627a5397341171a91b5d42af51d0fc Mon Sep 17 00:00:00 2001 From: Sarah Mischinger Date: Tue, 8 Jul 2025 14:04:52 +0200 Subject: [PATCH 3/4] update wording --- platform-includes/getting-started-verify/javascript.koa.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-includes/getting-started-verify/javascript.koa.mdx b/platform-includes/getting-started-verify/javascript.koa.mdx index 1d1d16a9f512fc..6d86d421eebd89 100644 --- a/platform-includes/getting-started-verify/javascript.koa.mdx +++ b/platform-includes/getting-started-verify/javascript.koa.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 router.get("/debug-sentry", function () { From 0bc3182824939897363312ac9fc9dfdb3000ee8d Mon Sep 17 00:00:00 2001 From: Sarah Mischinger Date: Tue, 8 Jul 2025 14:31:41 +0200 Subject: [PATCH 4/4] Update platform-includes/getting-started-verify/javascript.koa.mdx Co-authored-by: Charly Gomez --- platform-includes/getting-started-verify/javascript.koa.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-includes/getting-started-verify/javascript.koa.mdx b/platform-includes/getting-started-verify/javascript.koa.mdx index 6d86d421eebd89..02bf136d9326c7 100644 --- a/platform-includes/getting-started-verify/javascript.koa.mdx +++ b/platform-includes/getting-started-verify/javascript.koa.mdx @@ -3,7 +3,7 @@ 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 -router.get("/debug-sentry", function () { +router.get("/debug-sentry", function() { throw new Error("My first Sentry error!"); }); ```