Skip to content

fix(node): Skip capturing Hapi Boom error responses. #11151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 25, 2024

Conversation

onurtemizkan
Copy link
Collaborator

Resolves: #11069

After checking the behaviour, it seems to me that we don't need to capture any Boom responses, as the errors that may cause a 5xx response are already captured by the core logic. To add an option to control this behaviour, we need to update the usage of hapiErrorPlugin, converting it to a function signature, which IMO may not worth doing, as I'm not sure if users in general would need to use it.

This also adds expectError() to the node-integration-tests runner to allow 5xx responses to be tested.

Copy link
Contributor

github-actions bot commented Mar 17, 2024

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) 80.86 KB (added)
@sentry/browser (incl. Tracing, Replay) 72.21 KB (added)
@sentry/browser (incl. Tracing, Replay with Canvas) 76 KB (added)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 65.76 KB (added)
@sentry/browser (incl. Tracing) 36.8 KB (added)
@sentry/browser (incl. browserTracingIntegration) 36.8 KB (added)
@sentry/browser (incl. feedbackIntegration) 31.32 KB (added)
@sentry/browser (incl. feedbackModalIntegration) 31.43 KB (added)
@sentry/browser (incl. feedbackScreenshotIntegration) 31.44 KB (added)
@sentry/browser (incl. sendFeedback) 27.41 KB (added)
@sentry/browser 22.57 KB (added)
CDN Bundle (incl. Tracing, Replay, Feedback) 75.2 KB (added)
CDN Bundle (incl. Tracing, Replay) 70.04 KB (added)
CDN Bundle (incl. Tracing) 36.4 KB (added)
CDN Bundle 23.96 KB (added)
CDN Bundle (incl. Tracing, Replay) - uncompressed 220.02 KB (added)
CDN Bundle (incl. Tracing) - uncompressed 109.97 KB (added)
CDN Bundle - uncompressed 70.99 KB (added)
@sentry/react (incl. Tracing, Replay) 72.19 KB (added)
@sentry/react 22.6 KB (added)

@onurtemizkan onurtemizkan force-pushed the onur/hapi-skip-boom-responses branch 4 times, most recently from 762985d to 9b45cec Compare March 21, 2024 13:40
@onurtemizkan onurtemizkan force-pushed the onur/hapi-skip-boom-responses branch from 9b45cec to c671e1f Compare March 24, 2024 22:14
@onurtemizkan onurtemizkan marked this pull request as ready for review March 24, 2024 22:15
@AbhiPrasad AbhiPrasad changed the title ref(node): Skip capturing Hapi Boom error responses. fix(node): Skip capturing Hapi Boom error responses. Mar 25, 2024
@AbhiPrasad AbhiPrasad merged commit 87eed51 into develop Mar 25, 2024
@AbhiPrasad AbhiPrasad deleted the onur/hapi-skip-boom-responses branch March 25, 2024 15:11
@AbhiPrasad AbhiPrasad mentioned this pull request Mar 25, 2024
AbhiPrasad pushed a commit that referenced this pull request Mar 27, 2024
Resolves: #11069

After checking the behaviour, it seems to me that we don't need to
capture any Boom responses, as the errors that may cause a `5xx`
response are already captured by the core logic. To add an option to
control this behaviour, we need to update the usage of
`hapiErrorPlugin`, converting it to a function signature, which IMO may
not worth doing, as I'm not sure if users in general would need to use
it.

This also adds `expectError()` to the `node-integration-tests` runner to
allow `5xx` responses to be tested.
AbhiPrasad pushed a commit that referenced this pull request Mar 27, 2024
Resolves: #11069

After checking the behaviour, it seems to me that we don't need to
capture any Boom responses, as the errors that may cause a `5xx`
response are already captured by the core logic. To add an option to
control this behaviour, we need to update the usage of
`hapiErrorPlugin`, converting it to a function signature, which IMO may
not worth doing, as I'm not sure if users in general would need to use
it.

This also adds `expectError()` to the `node-integration-tests` runner to
allow `5xx` responses to be tested.
AbhiPrasad added a commit that referenced this pull request Mar 28, 2024
cadesalaberry pushed a commit to cadesalaberry/sentry-javascript that referenced this pull request Apr 19, 2024
Resolves: getsentry#11069

After checking the behaviour, it seems to me that we don't need to
capture any Boom responses, as the errors that may cause a `5xx`
response are already captured by the core logic. To add an option to
control this behaviour, we need to update the usage of
`hapiErrorPlugin`, converting it to a function signature, which IMO may
not worth doing, as I'm not sure if users in general would need to use
it.

This also adds `expectError()` to the `node-integration-tests` runner to
allow `5xx` responses to be tested.
@camsteffen
Copy link

This doesn't seem to be in the 8.7.0 release?

@AbhiPrasad
Copy link
Member

This was released with 8.0.0 as part of the alpha. If the fix doesn't seem to be applying, could you create a GH issue and fill out the template? We will take a look!

@camsteffen
Copy link

camsteffen commented May 29, 2024

I mean this particular fix. It looks like develop has not been merged to master since this was merged.

Edit: I might just be confused about the project structure when looking at the downloaded source. I haven't actually reproduced.

@AbhiPrasad
Copy link
Member

https://github.com/getsentry/sentry-javascript/commits/master/?author=onurtemizkan

image

The commit shows up in the master branch

you're right though that master is the source of truth for the releases, but master and develop are synced up.

if you have a repro, thats best for us to take another look!

@onurtemizkan
Copy link
Collaborator Author

Looks like updates in this commit did not apply when we moved this integration from
packages/node/src/integrations/hapi/index.ts to
packages/node/src/integrations/tracing/hapi/index.ts

@AbhiPrasad
Copy link
Member

ah good catch!

does the same apply for v7?

@onurtemizkan
Copy link
Collaborator Author

@camsteffen
Copy link

Thanks!

@AbhiPrasad
Copy link
Member

@onurtemizkan thanks for catching this (and thank you @camsteffen for reporting!!)

we'll get this in with the next release

AbhiPrasad pushed a commit that referenced this pull request May 30, 2024
Recreating #11151 for
v8 again, as the updates seem to be lost when moving the instrumentation
inside the project structure.

The testing updates introduced in the original PR do exist in develop /
master, so this PR only reintroduces changes in the instrumentation
code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error handling within Hapi Sentry integration
4 participants