@sentry/cloudflare 9.14.0 → 9.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/async.js +4 -1
- package/build/cjs/async.js.map +1 -1
- package/build/cjs/client.js.map +1 -1
- package/build/cjs/d1.js.map +1 -1
- package/build/cjs/durableobject.js +213 -0
- package/build/cjs/durableobject.js.map +1 -0
- package/build/cjs/handler.js +56 -66
- package/build/cjs/handler.js.map +1 -1
- package/build/cjs/index.js +6 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/instrument.js +27 -0
- package/build/cjs/instrument.js.map +1 -0
- package/build/cjs/integrations/fetch.js.map +1 -1
- package/build/cjs/logs/exports.js +213 -0
- package/build/cjs/logs/exports.js.map +1 -0
- package/build/cjs/options.js +23 -0
- package/build/cjs/options.js.map +1 -0
- package/build/cjs/request.js +12 -0
- package/build/cjs/request.js.map +1 -1
- package/build/cjs/scope-utils.js.map +1 -1
- package/build/cjs/sdk.js +1 -0
- package/build/cjs/sdk.js.map +1 -1
- package/build/cjs/transport.js.map +1 -1
- package/build/cjs/vendor/stacktrace.js +0 -4
- package/build/cjs/vendor/stacktrace.js.map +1 -1
- package/build/esm/async.js +4 -1
- package/build/esm/async.js.map +1 -1
- package/build/esm/client.js.map +1 -1
- package/build/esm/d1.js.map +1 -1
- package/build/esm/durableobject.js +211 -0
- package/build/esm/durableobject.js.map +1 -0
- package/build/esm/handler.js +56 -66
- package/build/esm/handler.js.map +1 -1
- package/build/esm/index.js +4 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/instrument.js +24 -0
- package/build/esm/instrument.js.map +1 -0
- package/build/esm/integrations/fetch.js.map +1 -1
- package/build/esm/logs/exports.js +206 -0
- package/build/esm/logs/exports.js.map +1 -0
- package/build/esm/options.js +21 -0
- package/build/esm/options.js.map +1 -0
- package/build/esm/package.json +1 -1
- package/build/esm/request.js +13 -1
- package/build/esm/request.js.map +1 -1
- package/build/esm/scope-utils.js.map +1 -1
- package/build/esm/sdk.js +1 -0
- package/build/esm/sdk.js.map +1 -1
- package/build/esm/transport.js.map +1 -1
- package/build/esm/vendor/stacktrace.js +0 -4
- package/build/esm/vendor/stacktrace.js.map +1 -1
- package/build/types/async.d.ts.map +1 -1
- package/build/types/client.d.ts.map +1 -1
- package/build/types/durableobject.d.ts +38 -0
- package/build/types/durableobject.d.ts.map +1 -0
- package/build/types/handler.d.ts +2 -7
- package/build/types/handler.d.ts.map +1 -1
- package/build/types/index.d.ts +3 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/instrument.d.ts +9 -0
- package/build/types/instrument.d.ts.map +1 -0
- package/build/types/logs/exports.d.ts +169 -0
- package/build/types/logs/exports.d.ts.map +1 -0
- package/build/types/options.d.ts +12 -0
- package/build/types/options.d.ts.map +1 -0
- package/build/types/request.d.ts.map +1 -1
- package/build/types/scope-utils.d.ts.map +1 -1
- package/build/types/sdk.d.ts.map +1 -1
- package/build/types/vendor/stacktrace.d.ts.map +1 -1
- package/build/types-ts3.8/durableobject.d.ts +38 -0
- package/build/types-ts3.8/handler.d.ts +2 -7
- package/build/types-ts3.8/index.d.ts +4 -1
- package/build/types-ts3.8/instrument.d.ts +9 -0
- package/build/types-ts3.8/logs/exports.d.ts +169 -0
- package/build/types-ts3.8/options.d.ts +12 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","sources":["../../../src/integrations/fetch.ts"],"sourcesContent":["import type {\n Client,\n FetchBreadcrumbData,\n FetchBreadcrumbHint,\n HandlerDataFetch,\n IntegrationFn,\n Span,\n} from '@sentry/core';\nimport {\n
|
|
1
|
+
{"version":3,"file":"fetch.js","sources":["../../../src/integrations/fetch.ts"],"sourcesContent":["import type {\n Client,\n FetchBreadcrumbData,\n FetchBreadcrumbHint,\n HandlerDataFetch,\n IntegrationFn,\n Span,\n} from '@sentry/core';\nimport {\n addBreadcrumb,\n addFetchInstrumentationHandler,\n defineIntegration,\n getBreadcrumbLogLevelFromHttpStatusCode,\n getClient,\n instrumentFetchRequest,\n isSentryRequestUrl,\n LRUMap,\n stringMatchesSomePattern,\n} from '@sentry/core';\n\nconst INTEGRATION_NAME = 'Fetch';\n\nconst HAS_CLIENT_MAP = new WeakMap<Client, boolean>();\n\nexport interface Options {\n /**\n * Whether breadcrumbs should be recorded for requests\n * Defaults to true\n */\n breadcrumbs: boolean;\n\n /**\n * Function determining whether or not to create spans to track outgoing requests to the given URL.\n * By default, spans will be created for all outgoing requests.\n */\n shouldCreateSpanForRequest?: (url: string) => boolean;\n}\n\nconst _fetchIntegration = ((options: Partial<Options> = {}) => {\n const breadcrumbs = options.breadcrumbs === undefined ? true : options.breadcrumbs;\n const shouldCreateSpanForRequest = options.shouldCreateSpanForRequest;\n\n const _createSpanUrlMap = new LRUMap<string, boolean>(100);\n const _headersUrlMap = new LRUMap<string, boolean>(100);\n\n const spans: Record<string, Span> = {};\n\n /** Decides whether to attach trace data to the outgoing fetch request */\n function _shouldAttachTraceData(url: string): boolean {\n const client = getClient();\n\n if (!client) {\n return false;\n }\n\n const clientOptions = client.getOptions();\n\n if (clientOptions.tracePropagationTargets === undefined) {\n return true;\n }\n\n const cachedDecision = _headersUrlMap.get(url);\n if (cachedDecision !== undefined) {\n return cachedDecision;\n }\n\n const decision = stringMatchesSomePattern(url, clientOptions.tracePropagationTargets);\n _headersUrlMap.set(url, decision);\n return decision;\n }\n\n /** Helper that wraps shouldCreateSpanForRequest option */\n function _shouldCreateSpan(url: string): boolean {\n if (shouldCreateSpanForRequest === undefined) {\n return true;\n }\n\n const cachedDecision = _createSpanUrlMap.get(url);\n if (cachedDecision !== undefined) {\n return cachedDecision;\n }\n\n const decision = shouldCreateSpanForRequest(url);\n _createSpanUrlMap.set(url, decision);\n return decision;\n }\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n addFetchInstrumentationHandler(handlerData => {\n const client = getClient();\n if (!client || !HAS_CLIENT_MAP.get(client)) {\n return;\n }\n\n if (isSentryRequestUrl(handlerData.fetchData.url, client)) {\n return;\n }\n\n instrumentFetchRequest(handlerData, _shouldCreateSpan, _shouldAttachTraceData, spans, 'auto.http.fetch');\n\n if (breadcrumbs) {\n createBreadcrumb(handlerData);\n }\n }, true);\n },\n setup(client) {\n HAS_CLIENT_MAP.set(client, true);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Creates spans and attaches tracing headers to fetch requests.\n */\nexport const fetchIntegration = defineIntegration(_fetchIntegration);\n\nfunction createBreadcrumb(handlerData: HandlerDataFetch): void {\n const { startTimestamp, endTimestamp } = handlerData;\n\n // We only capture complete fetch requests\n if (!endTimestamp) {\n return;\n }\n\n const breadcrumbData: FetchBreadcrumbData = {\n method: handlerData.fetchData.method,\n url: handlerData.fetchData.url,\n };\n\n if (handlerData.error) {\n const hint: FetchBreadcrumbHint = {\n data: handlerData.error,\n input: handlerData.args,\n startTimestamp,\n endTimestamp,\n };\n\n addBreadcrumb(\n {\n category: 'fetch',\n data: breadcrumbData,\n level: 'error',\n type: 'http',\n },\n hint,\n );\n } else {\n const response = handlerData.response as Response | undefined;\n\n breadcrumbData.request_body_size = handlerData.fetchData.request_body_size;\n breadcrumbData.response_body_size = handlerData.fetchData.response_body_size;\n breadcrumbData.status_code = response?.status;\n\n const hint: FetchBreadcrumbHint = {\n input: handlerData.args,\n response,\n startTimestamp,\n endTimestamp,\n };\n const level = getBreadcrumbLogLevelFromHttpStatusCode(breadcrumbData.status_code);\n\n addBreadcrumb(\n {\n category: 'fetch',\n data: breadcrumbData,\n type: 'http',\n level,\n },\n hint,\n );\n }\n}\n"],"names":["LRUMap","getClient","stringMatchesSomePattern","addFetchInstrumentationHandler","isSentryRequestUrl","instrumentFetchRequest","defineIntegration","addBreadcrumb","getBreadcrumbLogLevelFromHttpStatusCode"],"mappings":";;;;AAoBA,MAAM,gBAAA,GAAmB,OAAO;;AAEhC,MAAM,cAAe,GAAE,IAAI,OAAO,EAAmB;;AAgBrD,MAAM,iB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
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Capture a log with the given level.
|
|
7
|
+
*
|
|
8
|
+
* @param level - The level of the log.
|
|
9
|
+
* @param message - The message to log.
|
|
10
|
+
* @param attributes - Arbitrary structured data that stores information about the log - e.g., userId: 100.
|
|
11
|
+
* @param severityNumber - The severity number of the log.
|
|
12
|
+
*/
|
|
13
|
+
function captureLog(
|
|
14
|
+
level,
|
|
15
|
+
message,
|
|
16
|
+
attributes,
|
|
17
|
+
severityNumber,
|
|
18
|
+
) {
|
|
19
|
+
core._INTERNAL_captureLog({ level, message, attributes, severityNumber });
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @summary Capture a log with the `trace` level. Requires `_experiments.enableLogs` to be enabled.
|
|
24
|
+
*
|
|
25
|
+
* @param message - The message to log.
|
|
26
|
+
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { userId: 100, route: '/dashboard' }.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
*
|
|
30
|
+
* ```
|
|
31
|
+
* Sentry.logger.trace('User clicked submit button', {
|
|
32
|
+
* buttonId: 'submit-form',
|
|
33
|
+
* formId: 'user-profile',
|
|
34
|
+
* timestamp: Date.now()
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @example With template strings
|
|
39
|
+
*
|
|
40
|
+
* ```
|
|
41
|
+
* Sentry.logger.trace(Sentry.logger.fmt`User ${user} navigated to ${page}`, {
|
|
42
|
+
* userId: '123',
|
|
43
|
+
* sessionId: 'abc-xyz'
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
function trace(message, attributes) {
|
|
48
|
+
captureLog('trace', message, attributes);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @summary Capture a log with the `debug` level. Requires `_experiments.enableLogs` to be enabled.
|
|
53
|
+
*
|
|
54
|
+
* @param message - The message to log.
|
|
55
|
+
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { component: 'Header', state: 'loading' }.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
*
|
|
59
|
+
* ```
|
|
60
|
+
* Sentry.logger.debug('Component mounted', {
|
|
61
|
+
* component: 'UserProfile',
|
|
62
|
+
* props: { userId: 123 },
|
|
63
|
+
* renderTime: 150
|
|
64
|
+
* });
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @example With template strings
|
|
68
|
+
*
|
|
69
|
+
* ```
|
|
70
|
+
* Sentry.logger.debug(Sentry.logger.fmt`API request to ${endpoint} failed`, {
|
|
71
|
+
* statusCode: 404,
|
|
72
|
+
* requestId: 'req-123',
|
|
73
|
+
* duration: 250
|
|
74
|
+
* });
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
function debug(message, attributes) {
|
|
78
|
+
captureLog('debug', message, attributes);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @summary Capture a log with the `info` level. Requires `_experiments.enableLogs` to be enabled.
|
|
83
|
+
*
|
|
84
|
+
* @param message - The message to log.
|
|
85
|
+
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { feature: 'checkout', status: 'completed' }.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
*
|
|
89
|
+
* ```
|
|
90
|
+
* Sentry.logger.info('User completed checkout', {
|
|
91
|
+
* orderId: 'order-123',
|
|
92
|
+
* amount: 99.99,
|
|
93
|
+
* paymentMethod: 'credit_card'
|
|
94
|
+
* });
|
|
95
|
+
* ```
|
|
96
|
+
*
|
|
97
|
+
* @example With template strings
|
|
98
|
+
*
|
|
99
|
+
* ```
|
|
100
|
+
* Sentry.logger.info(Sentry.logger.fmt`User ${user} updated profile picture`, {
|
|
101
|
+
* userId: 'user-123',
|
|
102
|
+
* imageSize: '2.5MB',
|
|
103
|
+
* timestamp: Date.now()
|
|
104
|
+
* });
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
function info(message, attributes) {
|
|
108
|
+
captureLog('info', message, attributes);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* @summary Capture a log with the `warn` level. Requires `_experiments.enableLogs` to be enabled.
|
|
113
|
+
*
|
|
114
|
+
* @param message - The message to log.
|
|
115
|
+
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { browser: 'Chrome', version: '91.0' }.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
*
|
|
119
|
+
* ```
|
|
120
|
+
* Sentry.logger.warn('Browser compatibility issue detected', {
|
|
121
|
+
* browser: 'Safari',
|
|
122
|
+
* version: '14.0',
|
|
123
|
+
* feature: 'WebRTC',
|
|
124
|
+
* fallback: 'enabled'
|
|
125
|
+
* });
|
|
126
|
+
* ```
|
|
127
|
+
*
|
|
128
|
+
* @example With template strings
|
|
129
|
+
*
|
|
130
|
+
* ```
|
|
131
|
+
* Sentry.logger.warn(Sentry.logger.fmt`API endpoint ${endpoint} is deprecated`, {
|
|
132
|
+
* recommendedEndpoint: '/api/v2/users',
|
|
133
|
+
* sunsetDate: '2024-12-31',
|
|
134
|
+
* clientVersion: '1.2.3'
|
|
135
|
+
* });
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
function warn(message, attributes) {
|
|
139
|
+
captureLog('warn', message, attributes);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* @summary Capture a log with the `error` level. Requires `_experiments.enableLogs` to be enabled.
|
|
144
|
+
*
|
|
145
|
+
* @param message - The message to log.
|
|
146
|
+
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { error: 'NetworkError', url: '/api/data' }.
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
*
|
|
150
|
+
* ```
|
|
151
|
+
* Sentry.logger.error('Failed to load user data', {
|
|
152
|
+
* error: 'NetworkError',
|
|
153
|
+
* url: '/api/users/123',
|
|
154
|
+
* statusCode: 500,
|
|
155
|
+
* retryCount: 3
|
|
156
|
+
* });
|
|
157
|
+
* ```
|
|
158
|
+
*
|
|
159
|
+
* @example With template strings
|
|
160
|
+
*
|
|
161
|
+
* ```
|
|
162
|
+
* Sentry.logger.error(Sentry.logger.fmt`Payment processing failed for order ${orderId}`, {
|
|
163
|
+
* error: 'InsufficientFunds',
|
|
164
|
+
* amount: 100.00,
|
|
165
|
+
* currency: 'USD',
|
|
166
|
+
* userId: 'user-456'
|
|
167
|
+
* });
|
|
168
|
+
* ```
|
|
169
|
+
*/
|
|
170
|
+
function error(message, attributes) {
|
|
171
|
+
captureLog('error', message, attributes);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* @summary Capture a log with the `fatal` level. Requires `_experiments.enableLogs` to be enabled.
|
|
176
|
+
*
|
|
177
|
+
* @param message - The message to log.
|
|
178
|
+
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { appState: 'corrupted', sessionId: 'abc-123' }.
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
*
|
|
182
|
+
* ```
|
|
183
|
+
* Sentry.logger.fatal('Application state corrupted', {
|
|
184
|
+
* lastKnownState: 'authenticated',
|
|
185
|
+
* sessionId: 'session-123',
|
|
186
|
+
* timestamp: Date.now(),
|
|
187
|
+
* recoveryAttempted: true
|
|
188
|
+
* });
|
|
189
|
+
* ```
|
|
190
|
+
*
|
|
191
|
+
* @example With template strings
|
|
192
|
+
*
|
|
193
|
+
* ```
|
|
194
|
+
* Sentry.logger.fatal(Sentry.logger.fmt`Critical system failure in ${service}`, {
|
|
195
|
+
* service: 'payment-processor',
|
|
196
|
+
* errorCode: 'CRITICAL_FAILURE',
|
|
197
|
+
* affectedUsers: 150,
|
|
198
|
+
* timestamp: Date.now()
|
|
199
|
+
* });
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
202
|
+
function fatal(message, attributes) {
|
|
203
|
+
captureLog('fatal', message, attributes);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
exports.fmt = core.fmt;
|
|
207
|
+
exports.debug = debug;
|
|
208
|
+
exports.error = error;
|
|
209
|
+
exports.fatal = fatal;
|
|
210
|
+
exports.info = info;
|
|
211
|
+
exports.trace = trace;
|
|
212
|
+
exports.warn = warn;
|
|
213
|
+
//# sourceMappingURL=exports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exports.js","sources":["../../../src/logs/exports.ts"],"sourcesContent":["import type { Log, LogSeverityLevel, ParameterizedString } from '@sentry/core';\nimport { _INTERNAL_captureLog } from '@sentry/core';\n\n/**\n * Capture a log with the given level.\n *\n * @param level - The level of the log.\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., userId: 100.\n * @param severityNumber - The severity number of the log.\n */\nfunction captureLog(\n level: LogSeverityLevel,\n message: ParameterizedString,\n attributes?: Log['attributes'],\n severityNumber?: Log['severityNumber'],\n): void {\n _INTERNAL_captureLog({ level, message, attributes, severityNumber });\n}\n\n/**\n * @summary Capture a log with the `trace` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { userId: 100, route: '/dashboard' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.trace('User clicked submit button', {\n * buttonId: 'submit-form',\n * formId: 'user-profile',\n * timestamp: Date.now()\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.trace(Sentry.logger.fmt`User ${user} navigated to ${page}`, {\n * userId: '123',\n * sessionId: 'abc-xyz'\n * });\n * ```\n */\nexport function trace(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('trace', message, attributes);\n}\n\n/**\n * @summary Capture a log with the `debug` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { component: 'Header', state: 'loading' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.debug('Component mounted', {\n * component: 'UserProfile',\n * props: { userId: 123 },\n * renderTime: 150\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.debug(Sentry.logger.fmt`API request to ${endpoint} failed`, {\n * statusCode: 404,\n * requestId: 'req-123',\n * duration: 250\n * });\n * ```\n */\nexport function debug(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('debug', message, attributes);\n}\n\n/**\n * @summary Capture a log with the `info` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { feature: 'checkout', status: 'completed' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.info('User completed checkout', {\n * orderId: 'order-123',\n * amount: 99.99,\n * paymentMethod: 'credit_card'\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.info(Sentry.logger.fmt`User ${user} updated profile picture`, {\n * userId: 'user-123',\n * imageSize: '2.5MB',\n * timestamp: Date.now()\n * });\n * ```\n */\nexport function info(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('info', message, attributes);\n}\n\n/**\n * @summary Capture a log with the `warn` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { browser: 'Chrome', version: '91.0' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.warn('Browser compatibility issue detected', {\n * browser: 'Safari',\n * version: '14.0',\n * feature: 'WebRTC',\n * fallback: 'enabled'\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.warn(Sentry.logger.fmt`API endpoint ${endpoint} is deprecated`, {\n * recommendedEndpoint: '/api/v2/users',\n * sunsetDate: '2024-12-31',\n * clientVersion: '1.2.3'\n * });\n * ```\n */\nexport function warn(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('warn', message, attributes);\n}\n\n/**\n * @summary Capture a log with the `error` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { error: 'NetworkError', url: '/api/data' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.error('Failed to load user data', {\n * error: 'NetworkError',\n * url: '/api/users/123',\n * statusCode: 500,\n * retryCount: 3\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.error(Sentry.logger.fmt`Payment processing failed for order ${orderId}`, {\n * error: 'InsufficientFunds',\n * amount: 100.00,\n * currency: 'USD',\n * userId: 'user-456'\n * });\n * ```\n */\nexport function error(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('error', message, attributes);\n}\n\n/**\n * @summary Capture a log with the `fatal` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { appState: 'corrupted', sessionId: 'abc-123' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.fatal('Application state corrupted', {\n * lastKnownState: 'authenticated',\n * sessionId: 'session-123',\n * timestamp: Date.now(),\n * recoveryAttempted: true\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.fatal(Sentry.logger.fmt`Critical system failure in ${service}`, {\n * service: 'payment-processor',\n * errorCode: 'CRITICAL_FAILURE',\n * affectedUsers: 150,\n * timestamp: Date.now()\n * });\n * ```\n */\nexport function fatal(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('fatal', message, attributes);\n}\n\nexport { fmt } from '@sentry/core';\n"],"names":["_INTERNAL_captureLog"],"mappings":";;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU;AACnB,EAAE,KAAK;AACP,EAAE,OAAO;AACT,EAAE,UAAU;AACZ,EAAE,cAAc;AAChB,EAAQ;AACR,EAAEA,yBAAoB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,cAAe,EAAC,CAAC;AACtE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAC,OAAO,EAAuB,UAAU,EAA4B;AAC1F,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC;AAC1C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAC,OAAO,EAAuB,UAAU,EAA4B;AAC1F,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC;AAC1C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,IAAI,CAAC,OAAO,EAAuB,UAAU,EAA4B;AACzF,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,IAAI,CAAC,OAAO,EAAuB,UAAU,EAA4B;AACzF,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAC,OAAO,EAAuB,UAAU,EAA4B;AAC1F,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC;AAC1C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAC,OAAO,EAAuB,UAAU,EAA4B;AAC1F,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC;AAC1C;;;;;;;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Merges the options passed in from the user with the options we read from
|
|
5
|
+
* the Cloudflare `env` environment variable object.
|
|
6
|
+
*
|
|
7
|
+
* @param userOptions - The options passed in from the user.
|
|
8
|
+
* @param env - The environment variables.
|
|
9
|
+
*
|
|
10
|
+
* @returns The final options.
|
|
11
|
+
*/
|
|
12
|
+
function getFinalOptions(userOptions, env) {
|
|
13
|
+
if (typeof env !== 'object' || env === null) {
|
|
14
|
+
return userOptions;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const release = 'SENTRY_RELEASE' in env && typeof env.SENTRY_RELEASE === 'string' ? env.SENTRY_RELEASE : undefined;
|
|
18
|
+
|
|
19
|
+
return { release, ...userOptions };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
exports.getFinalOptions = getFinalOptions;
|
|
23
|
+
//# sourceMappingURL=options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sources":["../../src/options.ts"],"sourcesContent":["import type { CloudflareOptions } from './client';\n\n/**\n * Merges the options passed in from the user with the options we read from\n * the Cloudflare `env` environment variable object.\n *\n * @param userOptions - The options passed in from the user.\n * @param env - The environment variables.\n *\n * @returns The final options.\n */\nexport function getFinalOptions(userOptions: CloudflareOptions, env: unknown): CloudflareOptions {\n if (typeof env !== 'object' || env === null) {\n return userOptions;\n }\n\n const release = 'SENTRY_RELEASE' in env && typeof env.SENTRY_RELEASE === 'string' ? env.SENTRY_RELEASE : undefined;\n\n return { release, ...userOptions };\n}\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,eAAe,CAAC,WAAW,EAAqB,GAAG,EAA8B;AACjG,EAAE,IAAI,OAAO,GAAI,KAAI,YAAY,GAAA,KAAQ,IAAI,EAAE;AAC/C,IAAI,OAAO,WAAW;AACtB;;AAEA,EAAE,MAAM,OAAQ,GAAE,oBAAoB,GAAA,IAAO,OAAO,GAAG,CAAC,cAAA,KAAmB,QAAS,GAAE,GAAG,CAAC,cAAA,GAAiB,SAAS;;AAEpH,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,aAAa;AACpC;;;;"}
|
package/build/cjs/request.js
CHANGED
|
@@ -56,6 +56,18 @@ function wrapRequestHandler(
|
|
|
56
56
|
|
|
57
57
|
const routeName = `${request.method} ${pathname ? core.stripUrlQueryAndFragment(pathname) : '/'}`;
|
|
58
58
|
|
|
59
|
+
// Do not capture spans for OPTIONS and HEAD requests
|
|
60
|
+
if (request.method === 'OPTIONS' || request.method === 'HEAD') {
|
|
61
|
+
try {
|
|
62
|
+
return await handler();
|
|
63
|
+
} catch (e) {
|
|
64
|
+
core.captureException(e, { mechanism: { handled: false, type: 'cloudflare' } });
|
|
65
|
+
throw e;
|
|
66
|
+
} finally {
|
|
67
|
+
context?.waitUntil(core.flush(2000));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
59
71
|
return core.continueTrace(
|
|
60
72
|
{ sentryTrace: request.headers.get('sentry-trace') || '', baggage: request.headers.get('baggage') },
|
|
61
73
|
() => {
|
package/build/cjs/request.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","sources":["../../src/request.ts"],"sourcesContent":["import type { ExecutionContext, IncomingRequestCfProperties } from '@cloudflare/workers-types';\nimport type { SpanAttributes } from '@sentry/core';\nimport {\n
|
|
1
|
+
{"version":3,"file":"request.js","sources":["../../src/request.ts"],"sourcesContent":["import type { ExecutionContext, IncomingRequestCfProperties } from '@cloudflare/workers-types';\nimport type { SpanAttributes } from '@sentry/core';\nimport {\n captureException,\n continueTrace,\n flush,\n SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n SEMANTIC_ATTRIBUTE_URL_FULL,\n setHttpStatus,\n startSpan,\n stripUrlQueryAndFragment,\n withIsolationScope,\n} from '@sentry/core';\nimport type { CloudflareOptions } from './client';\nimport { addCloudResourceContext, addCultureContext, addRequest } from './scope-utils';\nimport { init } from './sdk';\n\ninterface RequestHandlerWrapperOptions {\n options: CloudflareOptions;\n request: Request<unknown, IncomingRequestCfProperties<unknown>>;\n context: ExecutionContext;\n}\n\n/**\n * Wraps a cloudflare request handler in Sentry instrumentation\n */\nexport function wrapRequestHandler(\n wrapperOptions: RequestHandlerWrapperOptions,\n handler: (...args: unknown[]) => Response | Promise<Response>,\n): Promise<Response> {\n return withIsolationScope(async isolationScope => {\n const { options, request } = wrapperOptions;\n\n // In certain situations, the passed context can become undefined.\n // For example, for Astro while prerendering pages at build time.\n // see: https://github.com/getsentry/sentry-javascript/issues/13217\n const context = wrapperOptions.context as ExecutionContext | undefined;\n\n const client = init(options);\n isolationScope.setClient(client);\n\n const attributes: SpanAttributes = {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.cloudflare',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.server',\n [SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD]: request.method,\n [SEMANTIC_ATTRIBUTE_URL_FULL]: request.url,\n };\n\n const contentLength = request.headers.get('content-length');\n if (contentLength) {\n attributes['http.request.body.size'] = parseInt(contentLength, 10);\n }\n\n let pathname = '';\n try {\n const url = new URL(request.url);\n pathname = url.pathname;\n attributes['server.address'] = url.hostname;\n attributes['url.scheme'] = url.protocol.replace(':', '');\n } catch {\n // skip\n }\n\n addCloudResourceContext(isolationScope);\n if (request) {\n addRequest(isolationScope, request);\n if (request.cf) {\n addCultureContext(isolationScope, request.cf);\n attributes['network.protocol.name'] = request.cf.httpProtocol;\n }\n }\n\n const routeName = `${request.method} ${pathname ? stripUrlQueryAndFragment(pathname) : '/'}`;\n\n // Do not capture spans for OPTIONS and HEAD requests\n if (request.method === 'OPTIONS' || request.method === 'HEAD') {\n try {\n return await handler();\n } catch (e) {\n captureException(e, { mechanism: { handled: false, type: 'cloudflare' } });\n throw e;\n } finally {\n context?.waitUntil(flush(2000));\n }\n }\n\n return continueTrace(\n { sentryTrace: request.headers.get('sentry-trace') || '', baggage: request.headers.get('baggage') },\n () => {\n // Note: This span will not have a duration unless I/O happens in the handler. This is\n // because of how the cloudflare workers runtime works.\n // See: https://developers.cloudflare.com/workers/runtime-apis/performance/\n return startSpan(\n {\n name: routeName,\n attributes,\n },\n async span => {\n try {\n const res = await handler();\n setHttpStatus(span, res.status);\n return res;\n } catch (e) {\n captureException(e, { mechanism: { handled: false, type: 'cloudflare' } });\n throw e;\n } finally {\n context?.waitUntil(flush(2000));\n }\n },\n );\n },\n );\n });\n}\n"],"names":["withIsolationScope","init","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","SEMANTIC_ATTRIBUTE_SENTRY_SOURCE","SEMANTIC_ATTRIBUTE_SENTRY_OP","SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD","SEMANTIC_ATTRIBUTE_URL_FULL","addCloudResourceContext","addRequest","addCultureContext","stripUrlQueryAndFragment","captureException","flush","continueTrace","startSpan","setHttpStatus"],"mappings":";;;;;;AA0BA;AACA;AACA;AACO,SAAS,kBAAkB;AAClC,EAAE,cAAc;AAChB,EAAE,OAAO;AACT,EAAqB;AACrB,EAAE,OAAOA,uBAAkB,CAAC,MAAM,kBAAkB;AACpD,IAAI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AA,CAAA,CAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,KAAA,EAAA,IAAA,EAAA,YAAA,EAAA,EAAA,CAAA;AACA,cAAA,MAAA,CAAA;AACA,aAAA,SAAA;AACA,cAAA,OAAA,EAAA,SAAA,CAAAC,UAAA,CAAA,IAAA,CAAA,CAAA;AACA;AACA,WAAA;AACA,SAAA;AACA,OAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-utils.js","sources":["../../src/scope-utils.ts"],"sourcesContent":["import type { IncomingRequestCfProperties } from '@cloudflare/workers-types';\
|
|
1
|
+
{"version":3,"file":"scope-utils.js","sources":["../../src/scope-utils.ts"],"sourcesContent":["import type { IncomingRequestCfProperties } from '@cloudflare/workers-types';\nimport type { Scope } from '@sentry/core';\nimport { winterCGRequestToRequestData } from '@sentry/core';\n\n/**\n * Set cloud resource context on scope.\n */\nexport function addCloudResourceContext(scope: Scope): void {\n scope.setContext('cloud_resource', {\n 'cloud.provider': 'cloudflare',\n });\n}\n\n/**\n * Set culture context on scope\n */\nexport function addCultureContext(scope: Scope, cf: IncomingRequestCfProperties): void {\n scope.setContext('culture', {\n timezone: cf.timezone,\n });\n}\n\n/**\n * Set request data on scope\n */\nexport function addRequest(scope: Scope, request: Request): void {\n scope.setSDKProcessingMetadata({ normalizedRequest: winterCGRequestToRequestData(request) });\n}\n"],"names":["winterCGRequestToRequestData"],"mappings":";;;;AAIA;AACA;AACA;AACO,SAAS,uBAAuB,CAAC,KAAK,EAAe;AAC5D,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,EAAE;AACrC,IAAI,gBAAgB,EAAE,YAAY;AAClC,GAAG,CAAC;AACJ;;AAEA;AACA;AACA;AACO,SAAS,iBAAiB,CAAC,KAAK,EAAS,EAAE,EAAqC;AACvF,EAAE,KAAK,CAAC,UAAU,CAAC,SAAS,EAAE;AAC9B,IAAI,QAAQ,EAAE,EAAE,CAAC,QAAQ;AACzB,GAAG,CAAC;AACJ;;AAEA;AACA;AACA;AACO,SAAS,UAAU,CAAC,KAAK,EAAS,OAAO,EAAiB;AACjE,EAAE,KAAK,CAAC,wBAAwB,CAAC,EAAE,iBAAiB,EAAEA,iCAA4B,CAAC,OAAO,CAAE,EAAC,CAAC;AAC9F;;;;;;"}
|
package/build/cjs/sdk.js
CHANGED
|
@@ -17,6 +17,7 @@ function getDefaultIntegrations(options) {
|
|
|
17
17
|
core.functionToStringIntegration(),
|
|
18
18
|
core.linkedErrorsIntegration(),
|
|
19
19
|
fetch.fetchIntegration(),
|
|
20
|
+
// TODO(v10): the `include` object should be defined directly in the integration based on `sendDefaultPii`
|
|
20
21
|
core.requestDataIntegration(sendDefaultPii ? undefined : { include: { cookies: false } }),
|
|
21
22
|
core.consoleIntegration(),
|
|
22
23
|
];
|
package/build/cjs/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sources":["../../src/sdk.ts"],"sourcesContent":["import type { Integration } from '@sentry/core';\nimport {\n dedupeIntegration,\n functionToStringIntegration,\n getIntegrationsToSetup,\n inboundFiltersIntegration,\n initAndBind,\n linkedErrorsIntegration,\n requestDataIntegration,\n stackParserFromStackParserOptions,\n
|
|
1
|
+
{"version":3,"file":"sdk.js","sources":["../../src/sdk.ts"],"sourcesContent":["import type { Integration } from '@sentry/core';\nimport {\n consoleIntegration,\n dedupeIntegration,\n functionToStringIntegration,\n getIntegrationsToSetup,\n inboundFiltersIntegration,\n initAndBind,\n linkedErrorsIntegration,\n requestDataIntegration,\n stackParserFromStackParserOptions,\n} from '@sentry/core';\nimport type { CloudflareClientOptions, CloudflareOptions } from './client';\nimport { CloudflareClient } from './client';\nimport { fetchIntegration } from './integrations/fetch';\nimport { makeCloudflareTransport } from './transport';\nimport { defaultStackParser } from './vendor/stacktrace';\n\n/** Get the default integrations for the Cloudflare SDK. */\nexport function getDefaultIntegrations(options: CloudflareOptions): Integration[] {\n const sendDefaultPii = options.sendDefaultPii ?? false;\n return [\n dedupeIntegration(),\n // TODO(v10): Replace with `eventFiltersIntegration` once we remove the deprecated `inboundFiltersIntegration`\n // eslint-disable-next-line deprecation/deprecation\n inboundFiltersIntegration(),\n functionToStringIntegration(),\n linkedErrorsIntegration(),\n fetchIntegration(),\n // TODO(v10): the `include` object should be defined directly in the integration based on `sendDefaultPii`\n requestDataIntegration(sendDefaultPii ? undefined : { include: { cookies: false } }),\n consoleIntegration(),\n ];\n}\n\n/**\n * Initializes the cloudflare SDK.\n */\nexport function init(options: CloudflareOptions): CloudflareClient | undefined {\n if (options.defaultIntegrations === undefined) {\n options.defaultIntegrations = getDefaultIntegrations(options);\n }\n\n const clientOptions: CloudflareClientOptions = {\n ...options,\n stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),\n integrations: getIntegrationsToSetup(options),\n transport: options.transport || makeCloudflareTransport,\n };\n\n return initAndBind(CloudflareClient, clientOptions) as CloudflareClient;\n}\n"],"names":["dedupeIntegration","inboundFiltersIntegration","functionToStringIntegration","linkedErrorsIntegration","fetchIntegration","requestDataIntegration","consoleIntegration","stackParserFromStackParserOptions","defaultStackParser","getIntegrationsToSetup","makeCloudflareTransport","initAndBind","CloudflareClient"],"mappings":";;;;;;;;AAkBA;AACO,SAAS,sBAAsB,CAAC,OAAO,EAAoC;AAClF,EAAE,MAAM,cAAe,GAAE,OAAO,CAAC,cAAA,IAAkB,KAAK;AACxD,EAAE,OAAO;AACT,IAAIA,sBAAiB,EAAE;AACvB;AACA;AACA,IAAIC,8BAAyB,EAAE;AAC/B,IAAIC,gCAA2B,EAAE;AACjC,IAAIC,4BAAuB,EAAE;AAC7B,IAAIC,sBAAgB,EAAE;AACtB;AACA,IAAIC,2BAAsB,CAAC,cAAe,GAAE,YAAY,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,KAAM,EAAA,EAAG,CAAC;AACxF,IAAIC,uBAAkB,EAAE;AACxB,GAAG;AACH;;AAEA;AACA;AACA;AACO,SAAS,IAAI,CAAC,OAAO,EAAmD;AAC/E,EAAE,IAAI,OAAO,CAAC,mBAAoB,KAAI,SAAS,EAAE;AACjD,IAAI,OAAO,CAAC,mBAAA,GAAsB,sBAAsB,CAAC,OAAO,CAAC;AACjE;;AAEA,EAAE,MAAM,aAAa,GAA4B;AACjD,IAAI,GAAG,OAAO;AACd,IAAI,WAAW,EAAEC,sCAAiC,CAAC,OAAO,CAAC,WAAA,IAAeC,6BAAkB,CAAC;AAC7F,IAAI,YAAY,EAAEC,2BAAsB,CAAC,OAAO,CAAC;AACjD,IAAI,SAAS,EAAE,OAAO,CAAC,SAAA,IAAaC,iCAAuB;AAC3D,GAAG;;AAEH,EAAE,OAAOC,gBAAW,CAACC,uBAAgB,EAAE,aAAa,CAAE;AACtD;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.js","sources":["../../src/transport.ts"],"sourcesContent":["import type { BaseTransportOptions, Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/core';\nimport {
|
|
1
|
+
{"version":3,"file":"transport.js","sources":["../../src/transport.ts"],"sourcesContent":["import type { BaseTransportOptions, Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/core';\nimport { createTransport, SENTRY_BUFFER_FULL_ERROR, suppressTracing } from '@sentry/core';\n\nexport interface CloudflareTransportOptions extends BaseTransportOptions {\n /** Fetch API init parameters. */\n fetchOptions?: RequestInit;\n /** Custom headers for the transport. */\n headers?: { [key: string]: string };\n}\n\nconst DEFAULT_TRANSPORT_BUFFER_SIZE = 30;\n\n/**\n * This is a modified promise buffer that collects tasks until drain is called.\n * We need this in the edge runtime because edge function invocations may not share I/O objects, like fetch requests\n * and responses, and the normal PromiseBuffer inherently buffers stuff inbetween incoming requests.\n *\n * A limitation we need to be aware of is that DEFAULT_TRANSPORT_BUFFER_SIZE is the maximum amount of payloads the\n * SDK can send for a given edge function invocation.\n */\nexport class IsolatedPromiseBuffer {\n // We just have this field because the promise buffer interface requires it.\n // If we ever remove it from the interface we should also remove it here.\n public $: Array<PromiseLike<TransportMakeRequestResponse>>;\n\n private _taskProducers: (() => PromiseLike<TransportMakeRequestResponse>)[];\n\n private readonly _bufferSize: number;\n\n public constructor(_bufferSize = DEFAULT_TRANSPORT_BUFFER_SIZE) {\n this.$ = [];\n this._taskProducers = [];\n this._bufferSize = _bufferSize;\n }\n\n /**\n * @inheritdoc\n */\n public add(taskProducer: () => PromiseLike<TransportMakeRequestResponse>): PromiseLike<TransportMakeRequestResponse> {\n if (this._taskProducers.length >= this._bufferSize) {\n return Promise.reject(SENTRY_BUFFER_FULL_ERROR);\n }\n\n this._taskProducers.push(taskProducer);\n return Promise.resolve({});\n }\n\n /**\n * @inheritdoc\n */\n public drain(timeout?: number): PromiseLike<boolean> {\n const oldTaskProducers = [...this._taskProducers];\n this._taskProducers = [];\n\n return new Promise(resolve => {\n const timer = setTimeout(() => {\n if (timeout && timeout > 0) {\n resolve(false);\n }\n }, timeout);\n\n // This cannot reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n Promise.all(\n oldTaskProducers.map(taskProducer =>\n taskProducer().then(null, () => {\n // catch all failed requests\n }),\n ),\n ).then(() => {\n // resolve to true if all fetch requests settled\n clearTimeout(timer);\n resolve(true);\n });\n });\n }\n}\n\n/**\n * Creates a Transport that uses the native fetch API to send events to Sentry.\n */\nexport function makeCloudflareTransport(options: CloudflareTransportOptions): Transport {\n function makeRequest(request: TransportRequest): PromiseLike<TransportMakeRequestResponse> {\n const requestOptions: RequestInit = {\n body: request.body,\n method: 'POST',\n headers: options.headers,\n ...options.fetchOptions,\n };\n\n return suppressTracing(() => {\n return fetch(options.url, requestOptions).then(response => {\n return {\n statusCode: response.status,\n headers: {\n 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),\n 'retry-after': response.headers.get('Retry-After'),\n },\n };\n });\n });\n }\n\n return createTransport(options, makeRequest, new IsolatedPromiseBuffer(options.bufferSize));\n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AAS;AACT,OAAO,CAAC,IAAI,CAAC,MAAM;AACnB;AACA,QAAQ,YAAY,CAAC,KAAK,CAAC;AAC3B,QAAQ,OAAO,CAAC,IAAI,CAAC;AACrB,OAAO,CAAC;AACR,KAAK,CAAC;AACN;AACA;;AAEA;AACA;AACA;AACO,SAAS,uBAAuB,CAAC,OAAO,EAAyC;AACxF,EAAE,SAAS,WAAW,CAAC,OAAO,EAA+D;AAC7F,IAAI,MAAM,cAAc,GAAgB;AACxC,MAAM,IAAI,EAAE,OAAO,CAAC,IAAI;AACxB,MAAM,MAAM,EAAE,MAAM;AACpB,MAAM,OAAO,EAAE,OAAO,CAAC,OAAO;AAC9B,MAAM,GAAG,OAAO,CAAC,YAAY;AAC7B,KAAK;;AAEL,IAAI,OAAOC,oBAAe,CAAC,MAAM;AACjC,MAAM,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC,IAAI,CAAC,YAAY;AACjE,QAAQ,OAAO;AACf,UAAU,UAAU,EAAE,QAAQ,CAAC,MAAM;AACrC,UAAU,OAAO,EAAE;AACnB,YAAY,sBAAsB,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC;AAChF,YAAY,aAAa,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;AAC9D,WAAW;AACX,SAAS;AACT,OAAO,CAAC;AACR,KAAK,CAAC;AACN;;AAEA,EAAE,OAAOC,oBAAe,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,qBAAqB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAC7F;;;;;"}
|
|
@@ -2,10 +2,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
|
|
3
3
|
const core = require('@sentry/core');
|
|
4
4
|
|
|
5
|
-
// Vendored from https://github.com/robertcepa/toucan-js/blob/036568729e49d0a937de527dc32d73580d9a41b3/packages/toucan-js/src/stacktrace.ts
|
|
6
|
-
// MIT License
|
|
7
|
-
|
|
8
|
-
|
|
9
5
|
/**
|
|
10
6
|
* Stack line parser for Cloudflare Workers.
|
|
11
7
|
* This wraps node stack parser and adjusts root paths to match with source maps.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stacktrace.js","sources":["../../../src/vendor/stacktrace.ts"],"sourcesContent":["// Vendored from https://github.com/robertcepa/toucan-js/blob/036568729e49d0a937de527dc32d73580d9a41b3/packages/toucan-js/src/stacktrace.ts\n// MIT License\n\n// Copyright (c) 2022 Robert Cepa\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport {
|
|
1
|
+
{"version":3,"file":"stacktrace.js","sources":["../../../src/vendor/stacktrace.ts"],"sourcesContent":["// Vendored from https://github.com/robertcepa/toucan-js/blob/036568729e49d0a937de527dc32d73580d9a41b3/packages/toucan-js/src/stacktrace.ts\n// MIT License\n\n// Copyright (c) 2022 Robert Cepa\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport type { StackLineParser, StackLineParserFn, StackParser } from '@sentry/core';\nimport { basename, createStackParser, nodeStackLineParser } from '@sentry/core';\n\ntype GetModuleFn = (filename: string | undefined) => string | undefined;\n\n/**\n * Stack line parser for Cloudflare Workers.\n * This wraps node stack parser and adjusts root paths to match with source maps.\n *\n */\nfunction workersStackLineParser(getModule?: GetModuleFn): StackLineParser {\n const [arg1, arg2] = nodeStackLineParser(getModule);\n\n const fn: StackLineParserFn = line => {\n const result = arg2(line);\n if (result) {\n const filename = result.filename;\n // Workers runtime runs a single bundled file that is always in a virtual root\n result.abs_path = filename !== undefined && !filename.startsWith('/') ? `/${filename}` : filename;\n // There is no way to tell what code is in_app and what comes from dependencies (node_modules), since we have one bundled file.\n // So everything is in_app, unless an error comes from runtime function (ie. JSON.parse), which is determined by the presence of filename.\n result.in_app = filename !== undefined;\n }\n return result;\n };\n\n return [arg1, fn];\n}\n\n/**\n * Gets the module from filename.\n *\n * @param filename\n * @returns Module name\n */\nexport function getModule(filename: string | undefined): string | undefined {\n if (!filename) {\n return;\n }\n\n // In Cloudflare Workers there is always only one bundled file\n return basename(filename, '.js');\n}\n\n/** Cloudflare Workers stack parser */\nexport const defaultStackParser: StackParser = createStackParser(workersStackLineParser(getModule));\n"],"names":["nodeStackLineParser","basename","createStackParser"],"mappings":";;;;AA4BA;AACA;AACA;AACA;AACA;AACA,SAAS,sBAAsB,CAAC,SAAS,EAAiC;AAC1E,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,IAAIA,wBAAmB,CAAC,SAAS,CAAC;;AAErD,EAAE,MAAM,EAAE,GAAsB,QAAQ;AACxC,IAAI,MAAM,MAAO,GAAE,IAAI,CAAC,IAAI,CAAC;AAC7B,IAAI,IAAI,MAAM,EAAE;AAChB,MAAM,MAAM,QAAA,GAAW,MAAM,CAAC,QAAQ;AACtC;AACA,MAAM,MAAM,CAAC,QAAS,GAAE,aAAa,SAAA,IAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAE,GAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAA,GAAA,QAAA;AACA;AACA;AACA,MAAA,MAAA,CAAA,MAAA,GAAA,QAAA,KAAA,SAAA;AACA;AACA,IAAA,OAAA,MAAA;AACA,GAAA;;AAEA,EAAA,OAAA,CAAA,IAAA,EAAA,EAAA,CAAA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,SAAA,CAAA,QAAA,EAAA;AACA,EAAA,IAAA,CAAA,QAAA,EAAA;AACA,IAAA;AACA;;AAEA;AACA,EAAA,OAAAC,aAAA,CAAA,QAAA,EAAA,KAAA,CAAA;AACA;;AAEA;AACA,MAAA,kBAAA,GAAAC,sBAAA,CAAA,sBAAA,CAAA,SAAA,CAAA;;;;;"}
|
package/build/esm/async.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { setAsyncContextStrategy, getDefaultIsolationScope, getDefaultCurrentScope } from '@sentry/core';
|
|
2
1
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
|
+
import { setAsyncContextStrategy, getDefaultIsolationScope, getDefaultCurrentScope } from '@sentry/core';
|
|
3
|
+
|
|
4
|
+
// Need to use node: prefix for cloudflare workers compatibility
|
|
5
|
+
// Note: Because we are using node:async_hooks, we need to set `node_compat` in the wrangler.toml
|
|
3
6
|
|
|
4
7
|
/**
|
|
5
8
|
* Sets the async context strategy to use AsyncLocalStorage.
|
package/build/esm/async.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async.js","sources":["../../src/async.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"async.js","sources":["../../src/async.ts"],"sourcesContent":["// Need to use node: prefix for cloudflare workers compatibility\n// Note: Because we are using node:async_hooks, we need to set `node_compat` in the wrangler.toml\nimport { AsyncLocalStorage } from 'node:async_hooks';\nimport type { Scope } from '@sentry/core';\nimport { getDefaultCurrentScope, getDefaultIsolationScope, setAsyncContextStrategy } from '@sentry/core';\n\n/**\n * Sets the async context strategy to use AsyncLocalStorage.\n *\n * AsyncLocalStorage is only available in the cloudflare workers runtime if you set\n * compatibility_flags = [\"nodejs_compat\"] or compatibility_flags = [\"nodejs_als\"]\n *\n * @internal Only exported to be used in higher-level Sentry packages\n * @hidden Only exported to be used in higher-level Sentry packages\n */\nexport function setAsyncLocalStorageAsyncContextStrategy(): void {\n const asyncStorage = new AsyncLocalStorage<{\n scope: Scope;\n isolationScope: Scope;\n }>();\n\n function getScopes(): { scope: Scope; isolationScope: Scope } {\n const scopes = asyncStorage.getStore();\n\n if (scopes) {\n return scopes;\n }\n\n // fallback behavior:\n // if, for whatever reason, we can't find scopes on the context here, we have to fix this somehow\n return {\n scope: getDefaultCurrentScope(),\n isolationScope: getDefaultIsolationScope(),\n };\n }\n\n function withScope<T>(callback: (scope: Scope) => T): T {\n const scope = getScopes().scope.clone();\n const isolationScope = getScopes().isolationScope;\n return asyncStorage.run({ scope, isolationScope }, () => {\n return callback(scope);\n });\n }\n\n function withSetScope<T>(scope: Scope, callback: (scope: Scope) => T): T {\n const isolationScope = getScopes().isolationScope.clone();\n return asyncStorage.run({ scope, isolationScope }, () => {\n return callback(scope);\n });\n }\n\n function withIsolationScope<T>(callback: (isolationScope: Scope) => T): T {\n const scope = getScopes().scope;\n const isolationScope = getScopes().isolationScope.clone();\n return asyncStorage.run({ scope, isolationScope }, () => {\n return callback(isolationScope);\n });\n }\n\n function withSetIsolationScope<T>(isolationScope: Scope, callback: (isolationScope: Scope) => T): T {\n const scope = getScopes().scope;\n return asyncStorage.run({ scope, isolationScope }, () => {\n return callback(isolationScope);\n });\n }\n\n setAsyncContextStrategy({\n withScope,\n withSetScope,\n withIsolationScope,\n withSetIsolationScope,\n getCurrentScope: () => getScopes().scope,\n getIsolationScope: () => getScopes().isolationScope,\n });\n}\n"],"names":[],"mappings":";;;AAAA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,wCAAwC,GAAS;AACjE,EAAE,MAAM,YAAA,GAAe,IAAI;;AAGzB,EAAI;;AAEN,EAAE,SAAS,SAAS,GAA4C;AAChE,IAAI,MAAM,MAAO,GAAE,YAAY,CAAC,QAAQ,EAAE;;AAE1C,IAAI,IAAI,MAAM,EAAE;AAChB,MAAM,OAAO,MAAM;AACnB;;AAEA;AACA;AACA,IAAI,OAAO;AACX,MAAM,KAAK,EAAE,sBAAsB,EAAE;AACrC,MAAM,cAAc,EAAE,wBAAwB,EAAE;AAChD,KAAK;AACL;;AAEA,EAAE,SAAS,SAAS,CAAI,QAAQ,EAA0B;AAC1D,IAAI,MAAM,KAAM,GAAE,SAAS,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE;AAC3C,IAAI,MAAM,cAAe,GAAE,SAAS,EAAE,CAAC,cAAc;AACrD,IAAI,OAAO,YAAY,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,cAAe,EAAC,EAAE,MAAM;AAC7D,MAAM,OAAO,QAAQ,CAAC,KAAK,CAAC;AAC5B,KAAK,CAAC;AACN;;AAEA,E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Options, ServerRuntimeClientOptions } from '@sentry/core';\nimport {
|
|
1
|
+
{"version":3,"file":"client.js","sources":["../../src/client.ts"],"sourcesContent":["import type { ClientOptions, Options, ServerRuntimeClientOptions } from '@sentry/core';\nimport { applySdkMetadata, ServerRuntimeClient } from '@sentry/core';\nimport type { CloudflareTransportOptions } from './transport';\n\n/**\n * The Sentry Cloudflare SDK Client.\n *\n * @see CloudflareClientOptions for documentation on configuration options.\n * @see ServerRuntimeClient for usage documentation.\n */\nexport class CloudflareClient extends ServerRuntimeClient<CloudflareClientOptions> {\n /**\n * Creates a new Cloudflare SDK instance.\n * @param options Configuration options for this SDK.\n */\n public constructor(options: CloudflareClientOptions) {\n applySdkMetadata(options, 'cloudflare');\n options._metadata = options._metadata || {};\n\n const clientOptions: ServerRuntimeClientOptions = {\n ...options,\n platform: 'javascript',\n // TODO: Grab version information\n runtime: { name: 'cloudflare' },\n // TODO: Add server name\n };\n\n super(clientOptions);\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\ninterface BaseCloudflareOptions {}\n\n/**\n * Configuration options for the Sentry Cloudflare SDK\n *\n * @see @sentry/core Options for more information.\n */\nexport interface CloudflareOptions extends Options<CloudflareTransportOptions>, BaseCloudflareOptions {}\n\n/**\n * Configuration options for the Sentry Cloudflare SDK Client class\n *\n * @see CloudflareClient for more information.\n */\nexport interface CloudflareClientOptions extends ClientOptions<CloudflareTransportOptions>, BaseCloudflareOptions {}\n"],"names":[],"mappings":";;AAIA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,gBAAA,SAAyB,mBAAmB,CAA0B;AACnF;AACA;AACA;AACA;AACA,GAAS,WAAW,CAAC,OAAO,EAA2B;AACvD,IAAI,gBAAgB,CAAC,OAAO,EAAE,YAAY,CAAC;AAC3C,IAAI,OAAO,CAAC,SAAU,GAAE,OAAO,CAAC,SAAA,IAAa,EAAE;;AAE/C,IAAI,MAAM,aAAa,GAA+B;AACtD,MAAM,GAAG,OAAO;AAChB,MAAM,QAAQ,EAAE,YAAY;AAC5B;AACA,MAAM,OAAO,EAAE,EAAE,IAAI,EAAE,cAAc;AACrC;AACA,KAAK;;AAEL,IAAI,KAAK,CAAC,aAAa,CAAC;AACxB;AACA;;AAEA;;;;"}
|
package/build/esm/d1.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d1.js","sources":["../../src/d1.ts"],"sourcesContent":["import type { D1Database, D1PreparedStatement, D1Response } from '@cloudflare/workers-types';\nimport {
|
|
1
|
+
{"version":3,"file":"d1.js","sources":["../../src/d1.ts"],"sourcesContent":["import type { D1Database, D1PreparedStatement, D1Response } from '@cloudflare/workers-types';\nimport type { Span, SpanAttributes, StartSpanOptions } from '@sentry/core';\nimport { addBreadcrumb, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_STATUS_ERROR, startSpan } from '@sentry/core';\n\n// Patching is based on internal Cloudflare D1 API\n// https://github.com/cloudflare/workerd/blob/cd5279e7b305003f1d9c851e73efa9d67e4b68b2/src/cloudflare/internal/d1-api.ts\n\nconst patchedStatement = new WeakSet<D1PreparedStatement>();\n\n/**\n * Patches the query methods of a Cloudflare D1 prepared statement with Sentry.\n */\nfunction instrumentD1PreparedStatementQueries(statement: D1PreparedStatement, query: string): D1PreparedStatement {\n if (patchedStatement.has(statement)) {\n return statement;\n }\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n statement.first = new Proxy(statement.first, {\n apply(target, thisArg, args: Parameters<typeof statement.first>) {\n return startSpan(createStartSpanOptions(query, 'first'), async () => {\n const res = await Reflect.apply(target, thisArg, args);\n createD1Breadcrumb(query, 'first');\n return res;\n });\n },\n });\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n statement.run = new Proxy(statement.run, {\n apply(target, thisArg, args: Parameters<typeof statement.run>) {\n return startSpan(createStartSpanOptions(query, 'run'), async span => {\n const d1Response = await Reflect.apply(target, thisArg, args);\n applyD1ReturnObjectToSpan(span, d1Response);\n createD1Breadcrumb(query, 'run', d1Response);\n return d1Response;\n });\n },\n });\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n statement.all = new Proxy(statement.all, {\n apply(target, thisArg, args: Parameters<typeof statement.all>) {\n return startSpan(createStartSpanOptions(query, 'all'), async span => {\n const d1Result = await Reflect.apply(target, thisArg, args);\n applyD1ReturnObjectToSpan(span, d1Result);\n createD1Breadcrumb(query, 'all', d1Result);\n return d1Result;\n });\n },\n });\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n statement.raw = new Proxy(statement.raw, {\n apply(target, thisArg, args: Parameters<typeof statement.raw>) {\n return startSpan(createStartSpanOptions(query, 'raw'), async () => {\n const res = await Reflect.apply(target, thisArg, args);\n createD1Breadcrumb(query, 'raw');\n return res;\n });\n },\n });\n\n patchedStatement.add(statement);\n\n return statement;\n}\n\n/**\n * Instruments a Cloudflare D1 prepared statement with Sentry.\n *\n * This is meant to be used as a top-level call, under the hood it calls `instrumentD1PreparedStatementQueries`\n * to patch the query methods. The reason for this abstraction is to ensure that the `bind` method is also patched.\n */\nfunction instrumentD1PreparedStatement(statement: D1PreparedStatement, query: string): D1PreparedStatement {\n // statement.bind() returns a new instance of D1PreparedStatement, so we have to patch it as well.\n // eslint-disable-next-line @typescript-eslint/unbound-method\n statement.bind = new Proxy(statement.bind, {\n apply(target, thisArg, args: Parameters<typeof statement.bind>) {\n return instrumentD1PreparedStatementQueries(Reflect.apply(target, thisArg, args), query);\n },\n });\n\n return instrumentD1PreparedStatementQueries(statement, query);\n}\n\n/**\n * Add D1Response meta information to a span.\n *\n * See: https://developers.cloudflare.com/d1/build-with-d1/d1-client-api/#return-object\n */\nfunction applyD1ReturnObjectToSpan(span: Span, d1Result: D1Response): void {\n if (!d1Result.success) {\n span.setStatus({ code: SPAN_STATUS_ERROR });\n }\n\n span.setAttributes(getAttributesFromD1Response(d1Result));\n}\n\nfunction getAttributesFromD1Response(d1Result: D1Response): SpanAttributes {\n return {\n 'cloudflare.d1.duration': d1Result.meta.duration,\n 'cloudflare.d1.rows_read': d1Result.meta.rows_read,\n 'cloudflare.d1.rows_written': d1Result.meta.rows_written,\n };\n}\n\nfunction createD1Breadcrumb(query: string, type: 'first' | 'run' | 'all' | 'raw', d1Result?: D1Response): void {\n addBreadcrumb({\n category: 'query',\n message: query,\n data: {\n ...(d1Result ? getAttributesFromD1Response(d1Result) : {}),\n 'cloudflare.d1.query_type': type,\n },\n });\n}\n\nfunction createStartSpanOptions(query: string, type: 'first' | 'run' | 'all' | 'raw'): StartSpanOptions {\n return {\n op: 'db.query',\n name: query,\n attributes: {\n 'cloudflare.d1.query_type': type,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.db.cloudflare.d1',\n },\n };\n}\n\n/**\n * Instruments Cloudflare D1 bindings with Sentry.\n *\n * Currently, only prepared statements are instrumented. `db.exec` and `db.batch` are not instrumented.\n *\n * @example\n *\n * ```js\n * // env.DB is the D1 DB binding configured in your `wrangler.toml`\n * const db = instrumentD1WithSentry(env.DB);\n * // Now you can use the database as usual\n * await db.prepare('SELECT * FROM table WHERE id = ?').bind(1).run();\n * ```\n */\nexport function instrumentD1WithSentry(db: D1Database): D1Database {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n db.prepare = new Proxy(db.prepare, {\n apply(target, thisArg, args: Parameters<typeof db.prepare>) {\n const [query] = args;\n return instrumentD1PreparedStatement(Reflect.apply(target, thisArg, args), query);\n },\n });\n\n return db;\n}\n"],"names":[],"mappings":";;AAIA;AACA;;AAEA,MAAM,gBAAiB,GAAE,IAAI,OAAO,EAAuB;;AAE3D;AACA;AACA;AACA,SAAS,oCAAoC,CAAC,SAAS,EAAuB,KAAK,EAA+B;AAClH,EAAE,IAAI,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;AACvC,IAAI,OAAO,SAAS;AACpB;;AAEA;AACA,EAAE,SAAS,CAAC,KAAA,GAAQ,IAAI,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE;AAC/C,IAAI,KAA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