Skip to content

Commit 175a6f0

Browse files
authored
feat(node): Add new options to nativeNodeFetchIntegration (#15282)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR This is the documentation for getsentry/sentry-javascript#17996 (it also adds the missing `spans`). Now I think I did a little hack, since these options are not available in `node-core`, but `javascript.node-core` is not a identifier. So I show a little warning for only `javascript.node` that it is not available in the `node-core` package. Since all other integrations use `@sentry/node` anyways, we don't have to show this warning so that is why I use the `<PlatformSection />` as well. ## 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 96345e7 commit 175a6f0

File tree

1 file changed

+18
-0
lines changed
  • docs/platforms/javascript/common/configuration/integrations

1 file changed

+18
-0
lines changed

docs/platforms/javascript/common/configuration/integrations/nodefetch.mdx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,21 @@ If set to false, no breadcrumbs will be captured.
6060
_Type: `(url: string) => boolean`_
6161

6262
Allows you to define a method to filter out outgoing requests based on the URL. If the method returns `true`, the request will be ignored.
63+
64+
### `spans`
65+
66+
_Type: `boolean`_
67+
68+
If set to false, no spans will be captured.
69+
70+
### `requestHook`
71+
72+
_Type: `(span: Span, request: Request) => void`_
73+
74+
A callback function that allows you to add custom attributes or modify the span for outgoing fetch requests. The function is called with the span and the native fetch `Request` object.
75+
76+
### `responseHook`
77+
78+
_Type: `(span: Span, response: Response) => void`_
79+
80+
A callback function that allows you to add custom attributes or modify the span based on the response of outgoing fetch requests. The function is called with the span and the native fetch `Response` object.

0 commit comments

Comments
 (0)