diff --git a/docs/platforms/javascript/guides/koa/index.mdx b/docs/platforms/javascript/guides/koa/index.mdx index ed61e821dd2d3..cb922bbeee92c 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 a17473f4be0db..550544f1a06ea 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!"); + } + ); +}); +``` + +