diff --git a/docs/platforms/javascript/guides/fastify/index.mdx b/docs/platforms/javascript/guides/fastify/index.mdx index 5c939e0d913a2d..a31ff6b89b7f83 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: diff --git a/platform-includes/getting-started-verify/javascript.fastify.mdx b/platform-includes/getting-started-verify/javascript.fastify.mdx index 5570cdb35cb332..6030ed25cfa218 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 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.get("/debug-sentry", async (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!"); + } + ); +}); +``` + +