@sentry/cloudflare 9.15.0 → 9.16.1
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/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 +5 -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/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/sdk.js +1 -0
- package/build/cjs/sdk.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/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/sdk.js +1 -0
- package/build/esm/sdk.js.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/sdk.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
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
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 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 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","
|
|
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,MAAM,EAAE,OAAO,EAAE,OAAQ,EAAA,GAAI,cAAc;;AAE/C;AACA;AACA;AACA,IAAI,MAAM,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A,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;;;;"}
|
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 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 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,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
|
+
{"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;;;;;"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { getClient, withScope, withIsolationScope, captureException, flush, SEMANTIC_ATTRIBUTE_SENTRY_OP, startSpan, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
|
|
2
|
+
import { setAsyncLocalStorageAsyncContextStrategy } from './async.js';
|
|
3
|
+
import { isInstrumented, markAsInstrumented } from './instrument.js';
|
|
4
|
+
import { getFinalOptions } from './options.js';
|
|
5
|
+
import { wrapRequestHandler } from './request.js';
|
|
6
|
+
import { init } from './sdk.js';
|
|
7
|
+
|
|
8
|
+
/* eslint-disable @typescript-eslint/unbound-method */
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
+
function wrapMethodWithSentry(
|
|
12
|
+
wrapperOptions,
|
|
13
|
+
handler,
|
|
14
|
+
callback,
|
|
15
|
+
) {
|
|
16
|
+
if (isInstrumented(handler)) {
|
|
17
|
+
return handler;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
markAsInstrumented(handler);
|
|
21
|
+
|
|
22
|
+
return new Proxy(handler, {
|
|
23
|
+
apply(target, thisArg, args) {
|
|
24
|
+
const currentClient = getClient();
|
|
25
|
+
// if a client is already set, use withScope, otherwise use withIsolationScope
|
|
26
|
+
const sentryWithScope = currentClient ? withScope : withIsolationScope;
|
|
27
|
+
return sentryWithScope(async scope => {
|
|
28
|
+
// In certain situations, the passed context can become undefined.
|
|
29
|
+
// For example, for Astro while prerendering pages at build time.
|
|
30
|
+
// see: https://github.com/getsentry/sentry-javascript/issues/13217
|
|
31
|
+
const context = wrapperOptions.context ;
|
|
32
|
+
|
|
33
|
+
const currentClient = scope.getClient();
|
|
34
|
+
if (!currentClient) {
|
|
35
|
+
const client = init(wrapperOptions.options);
|
|
36
|
+
scope.setClient(client);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (!wrapperOptions.spanName) {
|
|
40
|
+
try {
|
|
41
|
+
if (callback) {
|
|
42
|
+
callback(...args);
|
|
43
|
+
}
|
|
44
|
+
return await Reflect.apply(target, thisArg, args);
|
|
45
|
+
} catch (e) {
|
|
46
|
+
captureException(e, {
|
|
47
|
+
mechanism: {
|
|
48
|
+
type: 'cloudflare_durableobject',
|
|
49
|
+
handled: false,
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
throw e;
|
|
53
|
+
} finally {
|
|
54
|
+
context?.waitUntil(flush(2000));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const attributes = wrapperOptions.spanOp
|
|
59
|
+
? {
|
|
60
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: wrapperOptions.spanOp,
|
|
61
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.faas.cloudflare_durableobjects',
|
|
62
|
+
}
|
|
63
|
+
: {};
|
|
64
|
+
|
|
65
|
+
// Only create these spans if they have a parent span.
|
|
66
|
+
return startSpan({ name: wrapperOptions.spanName, attributes, onlyIfParent: true }, async () => {
|
|
67
|
+
try {
|
|
68
|
+
return await Reflect.apply(target, thisArg, args);
|
|
69
|
+
} catch (e) {
|
|
70
|
+
captureException(e, {
|
|
71
|
+
mechanism: {
|
|
72
|
+
type: 'cloudflare_durableobject',
|
|
73
|
+
handled: false,
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
throw e;
|
|
77
|
+
} finally {
|
|
78
|
+
context?.waitUntil(flush(2000));
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Instruments a Durable Object class to capture errors and performance data.
|
|
88
|
+
*
|
|
89
|
+
* Instruments the following methods:
|
|
90
|
+
* - fetch
|
|
91
|
+
* - alarm
|
|
92
|
+
* - webSocketMessage
|
|
93
|
+
* - webSocketClose
|
|
94
|
+
* - webSocketError
|
|
95
|
+
*
|
|
96
|
+
* as well as any other public RPC methods on the Durable Object instance.
|
|
97
|
+
*
|
|
98
|
+
* @param optionsCallback Function that returns the options for the SDK initialization.
|
|
99
|
+
* @param DurableObjectClass The Durable Object class to instrument.
|
|
100
|
+
* @returns The instrumented Durable Object class.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* class MyDurableObjectBase extends DurableObject {
|
|
105
|
+
* constructor(ctx: DurableObjectState, env: Env) {
|
|
106
|
+
* super(ctx, env);
|
|
107
|
+
* }
|
|
108
|
+
* }
|
|
109
|
+
*
|
|
110
|
+
* export const MyDurableObject = instrumentDurableObjectWithSentry(
|
|
111
|
+
* env => ({
|
|
112
|
+
* dsn: env.SENTRY_DSN,
|
|
113
|
+
* tracesSampleRate: 1.0,
|
|
114
|
+
* }),
|
|
115
|
+
* MyDurableObjectBase,
|
|
116
|
+
* );
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
function instrumentDurableObjectWithSentry(
|
|
120
|
+
optionsCallback,
|
|
121
|
+
DurableObjectClass,
|
|
122
|
+
) {
|
|
123
|
+
return new Proxy(DurableObjectClass, {
|
|
124
|
+
construct(target, [context, env]) {
|
|
125
|
+
setAsyncLocalStorageAsyncContextStrategy();
|
|
126
|
+
|
|
127
|
+
const options = getFinalOptions(optionsCallback(env), env);
|
|
128
|
+
|
|
129
|
+
const obj = new target(context, env);
|
|
130
|
+
|
|
131
|
+
// These are the methods that are available on a Durable Object
|
|
132
|
+
// ref: https://developers.cloudflare.com/durable-objects/api/base/
|
|
133
|
+
// obj.alarm
|
|
134
|
+
// obj.fetch
|
|
135
|
+
// obj.webSocketError
|
|
136
|
+
// obj.webSocketClose
|
|
137
|
+
// obj.webSocketMessage
|
|
138
|
+
|
|
139
|
+
// Any other public methods on the Durable Object instance are RPC calls.
|
|
140
|
+
|
|
141
|
+
if (obj.fetch && typeof obj.fetch === 'function' && !isInstrumented(obj.fetch)) {
|
|
142
|
+
obj.fetch = new Proxy(obj.fetch, {
|
|
143
|
+
apply(target, thisArg, args) {
|
|
144
|
+
return wrapRequestHandler({ options, request: args[0], context }, () =>
|
|
145
|
+
Reflect.apply(target, thisArg, args),
|
|
146
|
+
);
|
|
147
|
+
},
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
markAsInstrumented(obj.fetch);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (obj.alarm && typeof obj.alarm === 'function') {
|
|
154
|
+
obj.alarm = wrapMethodWithSentry({ options, context, spanName: 'alarm' }, obj.alarm);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (obj.webSocketMessage && typeof obj.webSocketMessage === 'function') {
|
|
158
|
+
obj.webSocketMessage = wrapMethodWithSentry(
|
|
159
|
+
{ options, context, spanName: 'webSocketMessage' },
|
|
160
|
+
obj.webSocketMessage,
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (obj.webSocketClose && typeof obj.webSocketClose === 'function') {
|
|
165
|
+
obj.webSocketClose = wrapMethodWithSentry({ options, context, spanName: 'webSocketClose' }, obj.webSocketClose);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (obj.webSocketError && typeof obj.webSocketError === 'function') {
|
|
169
|
+
obj.webSocketError = wrapMethodWithSentry(
|
|
170
|
+
{ options, context, spanName: 'webSocketError' },
|
|
171
|
+
obj.webSocketError,
|
|
172
|
+
(_, error) =>
|
|
173
|
+
captureException(error, {
|
|
174
|
+
mechanism: {
|
|
175
|
+
type: 'cloudflare_durableobject_websocket',
|
|
176
|
+
handled: false,
|
|
177
|
+
},
|
|
178
|
+
}),
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
for (const method of Object.getOwnPropertyNames(obj)) {
|
|
183
|
+
if (
|
|
184
|
+
method === 'fetch' ||
|
|
185
|
+
method === 'alarm' ||
|
|
186
|
+
method === 'webSocketError' ||
|
|
187
|
+
method === 'webSocketClose' ||
|
|
188
|
+
method === 'webSocketMessage'
|
|
189
|
+
) {
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
|
|
194
|
+
const value = (obj )[method] ;
|
|
195
|
+
if (typeof value === 'function') {
|
|
196
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
|
|
197
|
+
(obj )[method] = wrapMethodWithSentry(
|
|
198
|
+
{ options, context, spanName: method, spanOp: 'rpc' },
|
|
199
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
200
|
+
value ,
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return obj;
|
|
206
|
+
},
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export { instrumentDurableObjectWithSentry };
|
|
211
|
+
//# sourceMappingURL=durableobject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"durableobject.js","sources":["../../src/durableobject.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/unbound-method */\nimport {\n captureException,\n flush,\n getClient,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n startSpan,\n withIsolationScope,\n withScope,\n} from '@sentry/core';\nimport type { DurableObject } from 'cloudflare:workers';\nimport { setAsyncLocalStorageAsyncContextStrategy } from './async';\nimport type { CloudflareOptions } from './client';\nimport { isInstrumented, markAsInstrumented } from './instrument';\nimport { getFinalOptions } from './options';\nimport { wrapRequestHandler } from './request';\nimport { init } from './sdk';\n\ntype MethodWrapperOptions = {\n spanName?: string;\n spanOp?: string;\n options: CloudflareOptions;\n context: ExecutionContext | DurableObjectState;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction wrapMethodWithSentry<T extends (...args: any[]) => any>(\n wrapperOptions: MethodWrapperOptions,\n handler: T,\n callback?: (...args: Parameters<T>) => void,\n): T {\n if (isInstrumented(handler)) {\n return handler;\n }\n\n markAsInstrumented(handler);\n\n return new Proxy(handler, {\n apply(target, thisArg, args: Parameters<T>) {\n const currentClient = getClient();\n // if a client is already set, use withScope, otherwise use withIsolationScope\n const sentryWithScope = currentClient ? withScope : withIsolationScope;\n return sentryWithScope(async scope => {\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 currentClient = scope.getClient();\n if (!currentClient) {\n const client = init(wrapperOptions.options);\n scope.setClient(client);\n }\n\n if (!wrapperOptions.spanName) {\n try {\n if (callback) {\n callback(...args);\n }\n return await Reflect.apply(target, thisArg, args);\n } catch (e) {\n captureException(e, {\n mechanism: {\n type: 'cloudflare_durableobject',\n handled: false,\n },\n });\n throw e;\n } finally {\n context?.waitUntil(flush(2000));\n }\n }\n\n const attributes = wrapperOptions.spanOp\n ? {\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: wrapperOptions.spanOp,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.faas.cloudflare_durableobjects',\n }\n : {};\n\n // Only create these spans if they have a parent span.\n return startSpan({ name: wrapperOptions.spanName, attributes, onlyIfParent: true }, async () => {\n try {\n return await Reflect.apply(target, thisArg, args);\n } catch (e) {\n captureException(e, {\n mechanism: {\n type: 'cloudflare_durableobject',\n handled: false,\n },\n });\n throw e;\n } finally {\n context?.waitUntil(flush(2000));\n }\n });\n });\n },\n });\n}\n\n/**\n * Instruments a Durable Object class to capture errors and performance data.\n *\n * Instruments the following methods:\n * - fetch\n * - alarm\n * - webSocketMessage\n * - webSocketClose\n * - webSocketError\n *\n * as well as any other public RPC methods on the Durable Object instance.\n *\n * @param optionsCallback Function that returns the options for the SDK initialization.\n * @param DurableObjectClass The Durable Object class to instrument.\n * @returns The instrumented Durable Object class.\n *\n * @example\n * ```ts\n * class MyDurableObjectBase extends DurableObject {\n * constructor(ctx: DurableObjectState, env: Env) {\n * super(ctx, env);\n * }\n * }\n *\n * export const MyDurableObject = instrumentDurableObjectWithSentry(\n * env => ({\n * dsn: env.SENTRY_DSN,\n * tracesSampleRate: 1.0,\n * }),\n * MyDurableObjectBase,\n * );\n * ```\n */\nexport function instrumentDurableObjectWithSentry<E, T extends DurableObject<E>>(\n optionsCallback: (env: E) => CloudflareOptions,\n DurableObjectClass: new (state: DurableObjectState, env: E) => T,\n): new (state: DurableObjectState, env: E) => T {\n return new Proxy(DurableObjectClass, {\n construct(target, [context, env]) {\n setAsyncLocalStorageAsyncContextStrategy();\n\n const options = getFinalOptions(optionsCallback(env), env);\n\n const obj = new target(context, env);\n\n // These are the methods that are available on a Durable Object\n // ref: https://developers.cloudflare.com/durable-objects/api/base/\n // obj.alarm\n // obj.fetch\n // obj.webSocketError\n // obj.webSocketClose\n // obj.webSocketMessage\n\n // Any other public methods on the Durable Object instance are RPC calls.\n\n if (obj.fetch && typeof obj.fetch === 'function' && !isInstrumented(obj.fetch)) {\n obj.fetch = new Proxy(obj.fetch, {\n apply(target, thisArg, args) {\n return wrapRequestHandler({ options, request: args[0], context }, () =>\n Reflect.apply(target, thisArg, args),\n );\n },\n });\n\n markAsInstrumented(obj.fetch);\n }\n\n if (obj.alarm && typeof obj.alarm === 'function') {\n obj.alarm = wrapMethodWithSentry({ options, context, spanName: 'alarm' }, obj.alarm);\n }\n\n if (obj.webSocketMessage && typeof obj.webSocketMessage === 'function') {\n obj.webSocketMessage = wrapMethodWithSentry(\n { options, context, spanName: 'webSocketMessage' },\n obj.webSocketMessage,\n );\n }\n\n if (obj.webSocketClose && typeof obj.webSocketClose === 'function') {\n obj.webSocketClose = wrapMethodWithSentry({ options, context, spanName: 'webSocketClose' }, obj.webSocketClose);\n }\n\n if (obj.webSocketError && typeof obj.webSocketError === 'function') {\n obj.webSocketError = wrapMethodWithSentry(\n { options, context, spanName: 'webSocketError' },\n obj.webSocketError,\n (_, error) =>\n captureException(error, {\n mechanism: {\n type: 'cloudflare_durableobject_websocket',\n handled: false,\n },\n }),\n );\n }\n\n for (const method of Object.getOwnPropertyNames(obj)) {\n if (\n method === 'fetch' ||\n method === 'alarm' ||\n method === 'webSocketError' ||\n method === 'webSocketClose' ||\n method === 'webSocketMessage'\n ) {\n continue;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n const value = (obj as any)[method] as unknown;\n if (typeof value === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n (obj as any)[method] = wrapMethodWithSentry(\n { options, context, spanName: method, spanOp: 'rpc' },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value as (...args: any[]) => any,\n );\n }\n }\n\n return obj;\n },\n });\n}\n"],"names":[],"mappings":";;;;;;;AAAA;;AA0BA;AACA,SAAS,oBAAoB;AAC7B,EAAE,cAAc;AAChB,EAAE,OAAO;AACT,EAAE,QAAQ;AACV,EAAK;AACL,EAAE,IAAI,cAAc,CAAC,OAAO,CAAC,EAAE;AAC/B,IAAI,OAAO,OAAO;AAClB;;AAEA,EAAE,kBAAkB,CAAC,OAAO,CAAC;;AAE7B,EAAE,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE;AAC5B,IAAI,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAiB;AAChD,MAAM,MAAM,aAAA,GAAgB,SAAS,EAAE;AACvC;AACA,MAAM,MAAM,eAAgB,GAAE,gBAAgB,SAAA,GAAY,kBAAkB;AAC5E,MAAM,OAAO,eAAe,CAAC,MAAM,SAAS;AAC5C;AACA;AACA;AACA,QAAQ,MAAM,OAAA,GAAU,cAAc,CAAC,OAAQ;;AAE/C,QAAQ,MAAM,aAAc,GAAE,KAAK,CAAC,SAAS,EAAE;AAC/C,QAAQ,IAAI,CAAC,aAAa,EAAE;AAC5B,UAAU,MAAM,SAAS,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;AACrD,UA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