Skip to content

Commit 70878e6

Browse files
docs(js): Review and update Fastify quick start guide (#14249)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR Updated the Fastify quick start guide to be consistent with our other quick start guides. ~I want to merge #14218 first, as this branch contains changes that are also needed for the changes in this pr~ Closes #14246 ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [x] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)
1 parent d3e0ad5 commit 70878e6

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

docs/platforms/javascript/guides/fastify/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Fastify
3-
description: "This guide explains how to set up Sentry in your Fastify application."
3+
description: "Learn how to manually set up Sentry in your Fastify app and capture your first errors."
44
sdk: sentry.javascript.node
55
fallbackGuide: javascript.node
66
categories:
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
1+
### Issues
2+
3+
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:
4+
15
```javascript
26
app.get("/debug-sentry", function mainHandler(req, res) {
37
throw new Error("My first Sentry error!");
48
});
59
```
10+
11+
<OnboardingOption optionId="performance">
12+
13+
### Tracing
14+
15+
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:
16+
17+
```javascript
18+
app.get("/debug-sentry", async (request, reply) => {
19+
await Sentry.startSpan(
20+
{
21+
op: "test",
22+
name: "My First Test Transaction",
23+
},
24+
async () => {
25+
await new Promise((resolve) => setTimeout(resolve, 100)); // Wait for 100ms
26+
throw new Error("My first Sentry error!");
27+
}
28+
);
29+
});
30+
```
31+
32+
</OnboardingOption>

0 commit comments

Comments
 (0)