Skip to content

Commit 1fb45cc

Browse files
docs(js): Review and update Hapi quick start guide (#14292)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR Reviewed and updated the Hapi quick start guide Closes: #14289 ## 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 315a3e2 commit 1fb45cc

File tree

3 files changed

+42
-5
lines changed

3 files changed

+42
-5
lines changed
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Hapi
3-
description: "Learn about using Sentry with Hapi."
3+
description: "Learn how to manually set up Sentry in your Hapi app and capture your first errors."
44
sdk: sentry.javascript.node
55
fallbackGuide: javascript.node
66
categories:
@@ -9,8 +9,4 @@ categories:
99
- server-node
1010
---
1111

12-
<PlatformContent includePath="getting-started-primer" />
13-
14-
This guide explains how to set up Sentry in your Hapi application.
15-
1612
<PlatformContent includePath="getting-started-node" />

platform-includes/getting-started-verify-locate-data/javascript.node.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
1. Open the [**Issues**](https://sentry.io/orgredirect/organizations/:orgslug/issues) page and select an error from the issues list to view the full details and context of this error. For an interactive UI walkthrough, click [here](/product/sentry-basics/integrate-frontend/generate-first-error/#ui-walkthrough).
44
2. Open the [**Traces**](https://sentry.io/orgredirect/organizations/:orgslug/traces) page and select a trace to reveal more information about each span, its duration, and any errors. For an interactive UI walkthrough, click [here](/product/sentry-basics/distributed-tracing/generate-first-error/#ui-walkthrough).
55
3. Open the [**Profiles**](https://sentry.io/orgredirect/organizations/:orgslug/profiling) page, select a transaction, and then a profile ID to view its flame graph. For more information, click [here](/product/explore/profiling/profile-details/).
6+
4. Open the [**Logs**](https://sentry.io/explore/logs) page and filter by service, environment, or search keywords to view log entries from your application. For an interactive UI walkthrough, click [here](/product/explore/logs/#overview).
67

78
</Expandable>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
5+
```javascript
6+
server.route({
7+
method: "GET",
8+
path: "/debug-sentry",
9+
handler: (request, h) => {
10+
throw new Error("My first Sentry error!");
11+
},
12+
});
13+
```
14+
15+
<OnboardingOption optionId="performance">
16+
17+
### Tracing
18+
19+
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:
20+
21+
```javascript
22+
server.route({
23+
method: "GET",
24+
path: "/debug-sentry",
25+
handler: async (request, h) => {
26+
await Sentry.startSpan(
27+
{
28+
op: "test",
29+
name: "My First Test Transaction",
30+
},
31+
async () => {
32+
await new Promise((resolve) => setTimeout(resolve, 100));
33+
throw new Error("My first Sentry error!");
34+
}
35+
);
36+
},
37+
});
38+
```
39+
40+
</OnboardingOption>

0 commit comments

Comments
 (0)