Skip to content

Commit 9b1252e

Browse files
KyleTryoncursoragentcoolguyzone
authored
Fix broken link in Cloudflare docs (#14017)
[Cursor created PR - Reviewed by me] Broken links in the Cloudflare configuration documentation have been resolved. * A new file, `docs/platforms/javascript/common/configuration/integrations/fetchIntegration.mdx`, was created. * This addresses a 404 error caused by a missing page referenced by `fetchIntegration` in the integrations table. * The file includes metadata, documentation for `Sentry.fetchIntegration`, configuration options (`breadcrumbs`, `shouldCreateSpanForRequest`), and usage examples, specifically noting its relevance to Cloudflare Workers. * The link for `requestDataIntegration` in `platform-includes/configuration/integrations/javascript.cloudflare.mdx` was updated. * The previous link, `./requestDataIntegration`, had incorrect casing and pointed to a non-existent path. * The link was corrected to `./requestdata` to match the actual filename `requestdata.mdx`, ensuring consistency with other integration links. All links in the Cloudflare integrations table now correctly point to existing documentation files. --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Alex Krawiec <alex.krawiec@sentry.io>
1 parent bafd4e1 commit 9b1252e

File tree

2 files changed

+69
-1
lines changed

2 files changed

+69
-1
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
title: FetchIntegration
3+
description: "A default integration that creates spans and attaches tracing headers to fetch requests in Cloudflare Workers."
4+
supported:
5+
- javascript.cloudflare
6+
---
7+
8+
<Alert>
9+
10+
This integration only works inside the Cloudflare Workers runtime.
11+
12+
</Alert>
13+
14+
_Import name: `Sentry.fetchIntegration`_
15+
16+
This integration is enabled by default. If you want to disable it, you can [modify your default integrations](./../#modifying-default-integrations).
17+
18+
The `fetchIntegration` creates [spans](/concepts/key-terms/tracing/distributed-tracing/#traces-transactions-and-spans) and attaches tracing headers to fetch requests in Cloudflare Workers.
19+
20+
```JavaScript
21+
Sentry.init({
22+
integrations: [Sentry.fetchIntegration()],
23+
});
24+
```
25+
26+
## Options
27+
28+
### `breadcrumbs`
29+
30+
_Type: `boolean`_
31+
32+
If set to false, no breadcrumbs will be captured.
33+
34+
### `shouldCreateSpanForRequest`
35+
36+
_Type: `(url: string) => boolean`_
37+
38+
Allows you to define a method to determine whether or not to create spans to track outgoing requests to the given URL. By default, spans will be created for all outgoing requests.
39+
40+
```JavaScript
41+
Sentry.init({
42+
integrations: [
43+
Sentry.fetchIntegration({
44+
shouldCreateSpanForRequest: (url) => {
45+
// Only create spans for external API calls
46+
return url.includes('api.example.com');
47+
},
48+
}),
49+
],
50+
});
51+
```
52+
53+
## Usage
54+
55+
The fetch integration automatically instruments all `fetch()` calls made within your Cloudflare Worker. This includes:
56+
57+
- Creating performance spans for outgoing HTTP requests
58+
- Adding tracing headers to continue distributed traces
59+
- Capturing breadcrumbs for debugging purposes
60+
- Tracking request duration and response status
61+
62+
The integration works with both the standard `fetch()` API and any libraries that use fetch under the hood.
63+
64+
<Alert>
65+
66+
**Note:** If you need to disable fetch instrumentation for specific requests, use the `shouldCreateSpanForRequest` option to filter out unwanted requests.
67+
68+
</Alert>

platform-includes/configuration/integrations/javascript.cloudflare.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
| [`functionToStringIntegration`](./functiontostring) || | | | |
88
| [`inboundFiltersIntegration`](./inboundfilters) ||| | | |
99
| [`linkedErrorsIntegration`](./linkederrors) ||| | | |
10-
| [`requestDataIntegration`](./requestDataIntegration) || | | ||
10+
| [`requestDataIntegration`](./requestdata) || | | ||
1111
| [`captureConsoleIntegration`](./captureconsole) | | | | ||
1212
| [`extraErrorDataIntegration`](./extraerrordata) | | | | ||
1313
| [`rewriteFramesIntegration`](./rewriteframes) | || | | |

0 commit comments

Comments
 (0)