MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / setupOnce

Function setupOnce

packages/cloudflare/src/integrations/fetch.ts:90–111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

88 return {
89 name: INTEGRATION_NAME,
90 setupOnce() {
91 addFetchInstrumentationHandler(handlerData => {
92 const client = getClient();
93 const { propagateTraceparent } = client?.getOptions() || {};
94 if (!client || !HAS_CLIENT_MAP.get(client)) {
95 return;
96 }
97
98 if (isSentryRequestUrl(handlerData.fetchData.url, client)) {
99 return;
100 }
101
102 instrumentFetchRequest(handlerData, _shouldCreateSpan, _shouldAttachTraceData, spans, {
103 spanOrigin: 'auto.http.fetch',
104 propagateTraceparent,
105 });
106
107 if (breadcrumbs) {
108 createBreadcrumb(handlerData);
109 }
110 }, true);
111 },
112 setup(client) {
113 HAS_CLIENT_MAP.set(client, true);
114 },

Callers

nothing calls this directly

Calls 7

getClientFunction · 0.90
isSentryRequestUrlFunction · 0.90
instrumentFetchRequestFunction · 0.90
createBreadcrumbFunction · 0.70
getOptionsMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected