@sentry/cloudflare 9.40.0 → 10.0.0-alpha.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.
@@ -20,7 +20,7 @@ function captureLog(
20
20
  }
21
21
 
22
22
  /**
23
- * @summary Capture a log with the `trace` level. Requires `_experiments.enableLogs` to be enabled.
23
+ * @summary Capture a log with the `trace` level. Requires the `enableLogs` option to be enabled.
24
24
  *
25
25
  * @param message - The message to log.
26
26
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { userId: 100, route: '/dashboard' }.
@@ -49,7 +49,7 @@ function trace(message, attributes) {
49
49
  }
50
50
 
51
51
  /**
52
- * @summary Capture a log with the `debug` level. Requires `_experiments.enableLogs` to be enabled.
52
+ * @summary Capture a log with the `debug` level. Requires the `enableLogs` option to be enabled.
53
53
  *
54
54
  * @param message - The message to log.
55
55
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { component: 'Header', state: 'loading' }.
@@ -79,7 +79,7 @@ function debug(message, attributes) {
79
79
  }
80
80
 
81
81
  /**
82
- * @summary Capture a log with the `info` level. Requires `_experiments.enableLogs` to be enabled.
82
+ * @summary Capture a log with the `info` level. Requires the `enableLogs` option to be enabled.
83
83
  *
84
84
  * @param message - The message to log.
85
85
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { feature: 'checkout', status: 'completed' }.
@@ -109,7 +109,7 @@ function info(message, attributes) {
109
109
  }
110
110
 
111
111
  /**
112
- * @summary Capture a log with the `warn` level. Requires `_experiments.enableLogs` to be enabled.
112
+ * @summary Capture a log with the `warn` level. Requires the `enableLogs` option to be enabled.
113
113
  *
114
114
  * @param message - The message to log.
115
115
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { browser: 'Chrome', version: '91.0' }.
@@ -140,7 +140,7 @@ function warn(message, attributes) {
140
140
  }
141
141
 
142
142
  /**
143
- * @summary Capture a log with the `error` level. Requires `_experiments.enableLogs` to be enabled.
143
+ * @summary Capture a log with the `error` level. Requires the `enableLogs` option to be enabled.
144
144
  *
145
145
  * @param message - The message to log.
146
146
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { error: 'NetworkError', url: '/api/data' }.
@@ -172,7 +172,7 @@ function error(message, attributes) {
172
172
  }
173
173
 
174
174
  /**
175
- * @summary Capture a log with the `fatal` level. Requires `_experiments.enableLogs` to be enabled.
175
+ * @summary Capture a log with the `fatal` level. Requires the `enableLogs` option to be enabled.
176
176
  *
177
177
  * @param message - The message to log.
178
178
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { appState: 'corrupted', sessionId: 'abc-123' }.
@@ -1 +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,cAAA,EAAgB,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;;;;;;;;;;"}
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 the `enableLogs` option 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 the `enableLogs` option 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 the `enableLogs` option 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 the `enableLogs` option 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 the `enableLogs` option 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 the `enableLogs` option 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,cAAA,EAAgB,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;;;;;;;;;;"}
@@ -65,8 +65,7 @@ class SentryCloudflareTracer {
65
65
  ? context
66
66
  : typeof fn === 'function'
67
67
  ? fn
68
- : // eslint-disable-next-line @typescript-eslint/no-empty-function
69
- () => {}
68
+ : () => {}
70
69
  ) ;
71
70
 
72
71
  // In OTEL the semantic matches `startSpanManual` because spans are not auto-ended
@@ -1 +1 @@
1
- {"version":3,"file":"tracer.js","sources":["../../../src/opentelemetry/tracer.ts"],"sourcesContent":["import type { Context, Span, SpanOptions, Tracer, TracerProvider } from '@opentelemetry/api';\nimport { trace } from '@opentelemetry/api';\nimport { startInactiveSpan, startSpanManual } from '@sentry/core';\n\n/**\n * Set up a mock OTEL tracer to allow inter-op with OpenTelemetry emitted spans.\n * This is not perfect but handles easy/common use cases.\n */\nexport function setupOpenTelemetryTracer(): void {\n trace.setGlobalTracerProvider(new SentryCloudflareTraceProvider());\n}\n\nclass SentryCloudflareTraceProvider implements TracerProvider {\n private readonly _tracers: Map<string, Tracer> = new Map();\n\n public getTracer(name: string, version?: string, options?: { schemaUrl?: string }): Tracer {\n const key = `${name}@${version || ''}:${options?.schemaUrl || ''}`;\n if (!this._tracers.has(key)) {\n this._tracers.set(key, new SentryCloudflareTracer());\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this._tracers.get(key)!;\n }\n}\n\nclass SentryCloudflareTracer implements Tracer {\n public startSpan(name: string, options?: SpanOptions): Span {\n return startInactiveSpan({\n name,\n ...options,\n attributes: {\n ...options?.attributes,\n 'sentry.cloudflare_tracer': true,\n },\n });\n }\n\n /**\n * NOTE: This does not handle `context` being passed in. It will always put spans on the current scope.\n */\n public startActiveSpan<F extends (span: Span) => unknown>(name: string, fn: F): ReturnType<F>;\n public startActiveSpan<F extends (span: Span) => unknown>(name: string, options: SpanOptions, fn: F): ReturnType<F>;\n public startActiveSpan<F extends (span: Span) => unknown>(\n name: string,\n options: SpanOptions,\n context: Context,\n fn: F,\n ): ReturnType<F>;\n public startActiveSpan<F extends (span: Span) => unknown>(\n name: string,\n options: unknown,\n context?: unknown,\n fn?: F,\n ): ReturnType<F> {\n const opts = (typeof options === 'object' && options !== null ? options : {}) as SpanOptions;\n\n const spanOpts = {\n name,\n ...opts,\n attributes: {\n ...opts.attributes,\n 'sentry.cloudflare_tracer': true,\n },\n };\n\n const callback = (\n typeof options === 'function'\n ? options\n : typeof context === 'function'\n ? context\n : typeof fn === 'function'\n ? fn\n : // eslint-disable-next-line @typescript-eslint/no-empty-function\n () => {}\n ) as F;\n\n // In OTEL the semantic matches `startSpanManual` because spans are not auto-ended\n return startSpanManual(spanOpts, callback) as ReturnType<F>;\n }\n}\n"],"names":["trace","startInactiveSpan","startSpanManual"],"mappings":";;;;;AAIA;AACA;AACA;AACA;AACO,SAAS,wBAAwB,GAAS;AACjD,EAAEA,SAAK,CAAC,uBAAuB,CAAC,IAAI,6BAA6B,EAAE,CAAC;AACpE;;AAEA,MAAM,+BAAwD,CAAA,WAAA,GAAA,EAAA,6BAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA;AAC9D,mBAAmB,QAAQ,GAAwB,IAAI,GAAG,GAAC;;AAE3D,GAAS,SAAS,CAAC,IAAI,EAAU,OAAO,EAAW,OAAO,EAAmC;AAC7F,IAAI,MAAM,GAAA,GAAM,CAAC,EAAA,IAAA,CAAA,CAAA,EAAA,OAAA,IAAA,EAAA,CAAA,CAAA,EAAA,OAAA,EAAA,SAAA,IAAA,EAAA,CAAA,CAAA;AACA,IAAA,IAAA,CAAA,IAAA,CAAA,QAAA,CAAA,GAAA,CAAA,GAAA,CAAA,EAAA;AACA,MAAA,IAAA,CAAA,QAAA,CAAA,GAAA,CAAA,GAAA,EAAA,IAAA,sBAAA,EAAA,CAAA;AACA;;AAEA;AACA,IAAA,OAAA,IAAA,CAAA,QAAA,CAAA,GAAA,CAAA,GAAA,CAAA;AACA;AACA;;AAEA,MAAA,sBAAA,EAAA;AACA,GAAA,SAAA,CAAA,IAAA,EAAA,OAAA,EAAA;AACA,IAAA,OAAAC,sBAAA,CAAA;AACA,MAAA,IAAA;AACA,MAAA,GAAA,OAAA;AACA,MAAA,UAAA,EAAA;AACA,QAAA,GAAA,OAAA,EAAA,UAAA;AACA,QAAA,0BAAA,EAAA,IAAA;AACA,OAAA;AACA,KAAA,CAAA;AACA;;AAEA;AACA;AACA;;AASA,GAAA,eAAA;AACA,IAAA,IAAA;AACA,IAAA,OAAA;AACA,IAAA,OAAA;AACA,IAAA,EAAA;AACA,IAAA;AACA,IAAA,MAAA,IAAA,IAAA,OAAA,OAAA,KAAA,QAAA,IAAA,OAAA,KAAA,IAAA,GAAA,OAAA,GAAA,EAAA,CAAA;;AAEA,IAAA,MAAA,QAAA,GAAA;AACA,MAAA,IAAA;AACA,MAAA,GAAA,IAAA;AACA,MAAA,UAAA,EAAA;AACA,QAAA,GAAA,IAAA,CAAA,UAAA;AACA,QAAA,0BAAA,EAAA,IAAA;AACA,OAAA;AACA,KAAA;;AAEA,IAAA,MAAA,QAAA;AACA,MAAA,OAAA,OAAA,KAAA;AACA,UAAA;AACA,UAAA,OAAA,OAAA,KAAA;AACA,YAAA;AACA,YAAA,OAAA,EAAA,KAAA;AACA,cAAA;AACA;AACA,cAAA,MAAA;AACA,KAAA;;AAEA;AACA,IAAA,OAAAC,oBAAA,CAAA,QAAA,EAAA,QAAA,CAAA;AACA;AACA;;;;"}
1
+ {"version":3,"file":"tracer.js","sources":["../../../src/opentelemetry/tracer.ts"],"sourcesContent":["import type { Context, Span, SpanOptions, Tracer, TracerProvider } from '@opentelemetry/api';\nimport { trace } from '@opentelemetry/api';\nimport { startInactiveSpan, startSpanManual } from '@sentry/core';\n\n/**\n * Set up a mock OTEL tracer to allow inter-op with OpenTelemetry emitted spans.\n * This is not perfect but handles easy/common use cases.\n */\nexport function setupOpenTelemetryTracer(): void {\n trace.setGlobalTracerProvider(new SentryCloudflareTraceProvider());\n}\n\nclass SentryCloudflareTraceProvider implements TracerProvider {\n private readonly _tracers: Map<string, Tracer> = new Map();\n\n public getTracer(name: string, version?: string, options?: { schemaUrl?: string }): Tracer {\n const key = `${name}@${version || ''}:${options?.schemaUrl || ''}`;\n if (!this._tracers.has(key)) {\n this._tracers.set(key, new SentryCloudflareTracer());\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this._tracers.get(key)!;\n }\n}\n\nclass SentryCloudflareTracer implements Tracer {\n public startSpan(name: string, options?: SpanOptions): Span {\n return startInactiveSpan({\n name,\n ...options,\n attributes: {\n ...options?.attributes,\n 'sentry.cloudflare_tracer': true,\n },\n });\n }\n\n /**\n * NOTE: This does not handle `context` being passed in. It will always put spans on the current scope.\n */\n public startActiveSpan<F extends (span: Span) => unknown>(name: string, fn: F): ReturnType<F>;\n public startActiveSpan<F extends (span: Span) => unknown>(name: string, options: SpanOptions, fn: F): ReturnType<F>;\n public startActiveSpan<F extends (span: Span) => unknown>(\n name: string,\n options: SpanOptions,\n context: Context,\n fn: F,\n ): ReturnType<F>;\n public startActiveSpan<F extends (span: Span) => unknown>(\n name: string,\n options: unknown,\n context?: unknown,\n fn?: F,\n ): ReturnType<F> {\n const opts = (typeof options === 'object' && options !== null ? options : {}) as SpanOptions;\n\n const spanOpts = {\n name,\n ...opts,\n attributes: {\n ...opts.attributes,\n 'sentry.cloudflare_tracer': true,\n },\n };\n\n const callback = (\n typeof options === 'function'\n ? options\n : typeof context === 'function'\n ? context\n : typeof fn === 'function'\n ? fn\n : () => {}\n ) as F;\n\n // In OTEL the semantic matches `startSpanManual` because spans are not auto-ended\n return startSpanManual(spanOpts, callback) as ReturnType<F>;\n }\n}\n"],"names":["trace","startInactiveSpan","startSpanManual"],"mappings":";;;;;AAIA;AACA;AACA;AACA;AACO,SAAS,wBAAwB,GAAS;AACjD,EAAEA,SAAK,CAAC,uBAAuB,CAAC,IAAI,6BAA6B,EAAE,CAAC;AACpE;;AAEA,MAAM,+BAAwD,CAAA,WAAA,GAAA,EAAA,6BAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA;AAC9D,mBAAmB,QAAQ,GAAwB,IAAI,GAAG,GAAC;;AAE3D,GAAS,SAAS,CAAC,IAAI,EAAU,OAAO,EAAW,OAAO,EAAmC;AAC7F,IAAI,MAAM,GAAA,GAAM,CAAC,EAAA,IAAA,CAAA,CAAA,EAAA,OAAA,IAAA,EAAA,CAAA,CAAA,EAAA,OAAA,EAAA,SAAA,IAAA,EAAA,CAAA,CAAA;AACA,IAAA,IAAA,CAAA,IAAA,CAAA,QAAA,CAAA,GAAA,CAAA,GAAA,CAAA,EAAA;AACA,MAAA,IAAA,CAAA,QAAA,CAAA,GAAA,CAAA,GAAA,EAAA,IAAA,sBAAA,EAAA,CAAA;AACA;;AAEA;AACA,IAAA,OAAA,IAAA,CAAA,QAAA,CAAA,GAAA,CAAA,GAAA,CAAA;AACA;AACA;;AAEA,MAAA,sBAAA,EAAA;AACA,GAAA,SAAA,CAAA,IAAA,EAAA,OAAA,EAAA;AACA,IAAA,OAAAC,sBAAA,CAAA;AACA,MAAA,IAAA;AACA,MAAA,GAAA,OAAA;AACA,MAAA,UAAA,EAAA;AACA,QAAA,GAAA,OAAA,EAAA,UAAA;AACA,QAAA,0BAAA,EAAA,IAAA;AACA,OAAA;AACA,KAAA,CAAA;AACA;;AAEA;AACA;AACA;;AASA,GAAA,eAAA;AACA,IAAA,IAAA;AACA,IAAA,OAAA;AACA,IAAA,OAAA;AACA,IAAA,EAAA;AACA,IAAA;AACA,IAAA,MAAA,IAAA,IAAA,OAAA,OAAA,KAAA,QAAA,IAAA,OAAA,KAAA,IAAA,GAAA,OAAA,GAAA,EAAA,CAAA;;AAEA,IAAA,MAAA,QAAA,GAAA;AACA,MAAA,IAAA;AACA,MAAA,GAAA,IAAA;AACA,MAAA,UAAA,EAAA;AACA,QAAA,GAAA,IAAA,CAAA,UAAA;AACA,QAAA,0BAAA,EAAA,IAAA;AACA,OAAA;AACA,KAAA;;AAEA,IAAA,MAAA,QAAA;AACA,MAAA,OAAA,OAAA,KAAA;AACA,UAAA;AACA,UAAA,OAAA,OAAA,KAAA;AACA,YAAA;AACA,YAAA,OAAA,EAAA,KAAA;AACA,cAAA;AACA,cAAA,MAAA;AACA,KAAA;;AAEA;AACA,IAAA,OAAAC,oBAAA,CAAA,QAAA,EAAA,QAAA,CAAA;AACA;AACA;;;;"}
@@ -19,7 +19,7 @@ function captureLog(
19
19
  }
20
20
 
21
21
  /**
22
- * @summary Capture a log with the `trace` level. Requires `_experiments.enableLogs` to be enabled.
22
+ * @summary Capture a log with the `trace` level. Requires the `enableLogs` option to be enabled.
23
23
  *
24
24
  * @param message - The message to log.
25
25
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { userId: 100, route: '/dashboard' }.
@@ -48,7 +48,7 @@ function trace(message, attributes) {
48
48
  }
49
49
 
50
50
  /**
51
- * @summary Capture a log with the `debug` level. Requires `_experiments.enableLogs` to be enabled.
51
+ * @summary Capture a log with the `debug` level. Requires the `enableLogs` option to be enabled.
52
52
  *
53
53
  * @param message - The message to log.
54
54
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { component: 'Header', state: 'loading' }.
@@ -78,7 +78,7 @@ function debug(message, attributes) {
78
78
  }
79
79
 
80
80
  /**
81
- * @summary Capture a log with the `info` level. Requires `_experiments.enableLogs` to be enabled.
81
+ * @summary Capture a log with the `info` level. Requires the `enableLogs` option to be enabled.
82
82
  *
83
83
  * @param message - The message to log.
84
84
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { feature: 'checkout', status: 'completed' }.
@@ -108,7 +108,7 @@ function info(message, attributes) {
108
108
  }
109
109
 
110
110
  /**
111
- * @summary Capture a log with the `warn` level. Requires `_experiments.enableLogs` to be enabled.
111
+ * @summary Capture a log with the `warn` level. Requires the `enableLogs` option to be enabled.
112
112
  *
113
113
  * @param message - The message to log.
114
114
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { browser: 'Chrome', version: '91.0' }.
@@ -139,7 +139,7 @@ function warn(message, attributes) {
139
139
  }
140
140
 
141
141
  /**
142
- * @summary Capture a log with the `error` level. Requires `_experiments.enableLogs` to be enabled.
142
+ * @summary Capture a log with the `error` level. Requires the `enableLogs` option to be enabled.
143
143
  *
144
144
  * @param message - The message to log.
145
145
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { error: 'NetworkError', url: '/api/data' }.
@@ -171,7 +171,7 @@ function error(message, attributes) {
171
171
  }
172
172
 
173
173
  /**
174
- * @summary Capture a log with the `fatal` level. Requires `_experiments.enableLogs` to be enabled.
174
+ * @summary Capture a log with the `fatal` level. Requires the `enableLogs` option to be enabled.
175
175
  *
176
176
  * @param message - The message to log.
177
177
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { appState: 'corrupted', sessionId: 'abc-123' }.
@@ -1 +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":[],"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,EAAE,oBAAoB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,cAAA,EAAgB,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;;;;"}
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 the `enableLogs` option 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 the `enableLogs` option 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 the `enableLogs` option 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 the `enableLogs` option 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 the `enableLogs` option 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 the `enableLogs` option 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":[],"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,EAAE,oBAAoB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,cAAA,EAAgB,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;;;;"}
@@ -63,8 +63,7 @@ class SentryCloudflareTracer {
63
63
  ? context
64
64
  : typeof fn === 'function'
65
65
  ? fn
66
- : // eslint-disable-next-line @typescript-eslint/no-empty-function
67
- () => {}
66
+ : () => {}
68
67
  ) ;
69
68
 
70
69
  // In OTEL the semantic matches `startSpanManual` because spans are not auto-ended
@@ -1 +1 @@
1
- {"version":3,"file":"tracer.js","sources":["../../../src/opentelemetry/tracer.ts"],"sourcesContent":["import type { Context, Span, SpanOptions, Tracer, TracerProvider } from '@opentelemetry/api';\nimport { trace } from '@opentelemetry/api';\nimport { startInactiveSpan, startSpanManual } from '@sentry/core';\n\n/**\n * Set up a mock OTEL tracer to allow inter-op with OpenTelemetry emitted spans.\n * This is not perfect but handles easy/common use cases.\n */\nexport function setupOpenTelemetryTracer(): void {\n trace.setGlobalTracerProvider(new SentryCloudflareTraceProvider());\n}\n\nclass SentryCloudflareTraceProvider implements TracerProvider {\n private readonly _tracers: Map<string, Tracer> = new Map();\n\n public getTracer(name: string, version?: string, options?: { schemaUrl?: string }): Tracer {\n const key = `${name}@${version || ''}:${options?.schemaUrl || ''}`;\n if (!this._tracers.has(key)) {\n this._tracers.set(key, new SentryCloudflareTracer());\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this._tracers.get(key)!;\n }\n}\n\nclass SentryCloudflareTracer implements Tracer {\n public startSpan(name: string, options?: SpanOptions): Span {\n return startInactiveSpan({\n name,\n ...options,\n attributes: {\n ...options?.attributes,\n 'sentry.cloudflare_tracer': true,\n },\n });\n }\n\n /**\n * NOTE: This does not handle `context` being passed in. It will always put spans on the current scope.\n */\n public startActiveSpan<F extends (span: Span) => unknown>(name: string, fn: F): ReturnType<F>;\n public startActiveSpan<F extends (span: Span) => unknown>(name: string, options: SpanOptions, fn: F): ReturnType<F>;\n public startActiveSpan<F extends (span: Span) => unknown>(\n name: string,\n options: SpanOptions,\n context: Context,\n fn: F,\n ): ReturnType<F>;\n public startActiveSpan<F extends (span: Span) => unknown>(\n name: string,\n options: unknown,\n context?: unknown,\n fn?: F,\n ): ReturnType<F> {\n const opts = (typeof options === 'object' && options !== null ? options : {}) as SpanOptions;\n\n const spanOpts = {\n name,\n ...opts,\n attributes: {\n ...opts.attributes,\n 'sentry.cloudflare_tracer': true,\n },\n };\n\n const callback = (\n typeof options === 'function'\n ? options\n : typeof context === 'function'\n ? context\n : typeof fn === 'function'\n ? fn\n : // eslint-disable-next-line @typescript-eslint/no-empty-function\n () => {}\n ) as F;\n\n // In OTEL the semantic matches `startSpanManual` because spans are not auto-ended\n return startSpanManual(spanOpts, callback) as ReturnType<F>;\n }\n}\n"],"names":[],"mappings":";;;AAIA;AACA;AACA;AACA;AACO,SAAS,wBAAwB,GAAS;AACjD,EAAE,KAAK,CAAC,uBAAuB,CAAC,IAAI,6BAA6B,EAAE,CAAC;AACpE;;AAEA,MAAM,+BAAwD,CAAA,WAAA,GAAA,EAAA,6BAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA;AAC9D,mBAAmB,QAAQ,GAAwB,IAAI,GAAG,GAAC;;AAE3D,GAAS,SAAS,CAAC,IAAI,EAAU,OAAO,EAAW,OAAO,EAAmC;AAC7F,IAAI,MAAM,GAAA,GAAM,CAAC,EAAA,IAAA,CAAA,CAAA,EAAA,OAAA,IAAA,EAAA,CAAA,CAAA,EAAA,OAAA,EAAA,SAAA,IAAA,EAAA,CAAA,CAAA;AACA,IAAA,IAAA,CAAA,IAAA,CAAA,QAAA,CAAA,GAAA,CAAA,GAAA,CAAA,EAAA;AACA,MAAA,IAAA,CAAA,QAAA,CAAA,GAAA,CAAA,GAAA,EAAA,IAAA,sBAAA,EAAA,CAAA;AACA;;AAEA;AACA,IAAA,OAAA,IAAA,CAAA,QAAA,CAAA,GAAA,CAAA,GAAA,CAAA;AACA;AACA;;AAEA,MAAA,sBAAA,EAAA;AACA,GAAA,SAAA,CAAA,IAAA,EAAA,OAAA,EAAA;AACA,IAAA,OAAA,iBAAA,CAAA;AACA,MAAA,IAAA;AACA,MAAA,GAAA,OAAA;AACA,MAAA,UAAA,EAAA;AACA,QAAA,GAAA,OAAA,EAAA,UAAA;AACA,QAAA,0BAAA,EAAA,IAAA;AACA,OAAA;AACA,KAAA,CAAA;AACA;;AAEA;AACA;AACA;;AASA,GAAA,eAAA;AACA,IAAA,IAAA;AACA,IAAA,OAAA;AACA,IAAA,OAAA;AACA,IAAA,EAAA;AACA,IAAA;AACA,IAAA,MAAA,IAAA,IAAA,OAAA,OAAA,KAAA,QAAA,IAAA,OAAA,KAAA,IAAA,GAAA,OAAA,GAAA,EAAA,CAAA;;AAEA,IAAA,MAAA,QAAA,GAAA;AACA,MAAA,IAAA;AACA,MAAA,GAAA,IAAA;AACA,MAAA,UAAA,EAAA;AACA,QAAA,GAAA,IAAA,CAAA,UAAA;AACA,QAAA,0BAAA,EAAA,IAAA;AACA,OAAA;AACA,KAAA;;AAEA,IAAA,MAAA,QAAA;AACA,MAAA,OAAA,OAAA,KAAA;AACA,UAAA;AACA,UAAA,OAAA,OAAA,KAAA;AACA,YAAA;AACA,YAAA,OAAA,EAAA,KAAA;AACA,cAAA;AACA;AACA,cAAA,MAAA;AACA,KAAA;;AAEA;AACA,IAAA,OAAA,eAAA,CAAA,QAAA,EAAA,QAAA,CAAA;AACA;AACA;;;;"}
1
+ {"version":3,"file":"tracer.js","sources":["../../../src/opentelemetry/tracer.ts"],"sourcesContent":["import type { Context, Span, SpanOptions, Tracer, TracerProvider } from '@opentelemetry/api';\nimport { trace } from '@opentelemetry/api';\nimport { startInactiveSpan, startSpanManual } from '@sentry/core';\n\n/**\n * Set up a mock OTEL tracer to allow inter-op with OpenTelemetry emitted spans.\n * This is not perfect but handles easy/common use cases.\n */\nexport function setupOpenTelemetryTracer(): void {\n trace.setGlobalTracerProvider(new SentryCloudflareTraceProvider());\n}\n\nclass SentryCloudflareTraceProvider implements TracerProvider {\n private readonly _tracers: Map<string, Tracer> = new Map();\n\n public getTracer(name: string, version?: string, options?: { schemaUrl?: string }): Tracer {\n const key = `${name}@${version || ''}:${options?.schemaUrl || ''}`;\n if (!this._tracers.has(key)) {\n this._tracers.set(key, new SentryCloudflareTracer());\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this._tracers.get(key)!;\n }\n}\n\nclass SentryCloudflareTracer implements Tracer {\n public startSpan(name: string, options?: SpanOptions): Span {\n return startInactiveSpan({\n name,\n ...options,\n attributes: {\n ...options?.attributes,\n 'sentry.cloudflare_tracer': true,\n },\n });\n }\n\n /**\n * NOTE: This does not handle `context` being passed in. It will always put spans on the current scope.\n */\n public startActiveSpan<F extends (span: Span) => unknown>(name: string, fn: F): ReturnType<F>;\n public startActiveSpan<F extends (span: Span) => unknown>(name: string, options: SpanOptions, fn: F): ReturnType<F>;\n public startActiveSpan<F extends (span: Span) => unknown>(\n name: string,\n options: SpanOptions,\n context: Context,\n fn: F,\n ): ReturnType<F>;\n public startActiveSpan<F extends (span: Span) => unknown>(\n name: string,\n options: unknown,\n context?: unknown,\n fn?: F,\n ): ReturnType<F> {\n const opts = (typeof options === 'object' && options !== null ? options : {}) as SpanOptions;\n\n const spanOpts = {\n name,\n ...opts,\n attributes: {\n ...opts.attributes,\n 'sentry.cloudflare_tracer': true,\n },\n };\n\n const callback = (\n typeof options === 'function'\n ? options\n : typeof context === 'function'\n ? context\n : typeof fn === 'function'\n ? fn\n : () => {}\n ) as F;\n\n // In OTEL the semantic matches `startSpanManual` because spans are not auto-ended\n return startSpanManual(spanOpts, callback) as ReturnType<F>;\n }\n}\n"],"names":[],"mappings":";;;AAIA;AACA;AACA;AACA;AACO,SAAS,wBAAwB,GAAS;AACjD,EAAE,KAAK,CAAC,uBAAuB,CAAC,IAAI,6BAA6B,EAAE,CAAC;AACpE;;AAEA,MAAM,+BAAwD,CAAA,WAAA,GAAA,EAAA,6BAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA;AAC9D,mBAAmB,QAAQ,GAAwB,IAAI,GAAG,GAAC;;AAE3D,GAAS,SAAS,CAAC,IAAI,EAAU,OAAO,EAAW,OAAO,EAAmC;AAC7F,IAAI,MAAM,GAAA,GAAM,CAAC,EAAA,IAAA,CAAA,CAAA,EAAA,OAAA,IAAA,EAAA,CAAA,CAAA,EAAA,OAAA,EAAA,SAAA,IAAA,EAAA,CAAA,CAAA;AACA,IAAA,IAAA,CAAA,IAAA,CAAA,QAAA,CAAA,GAAA,CAAA,GAAA,CAAA,EAAA;AACA,MAAA,IAAA,CAAA,QAAA,CAAA,GAAA,CAAA,GAAA,EAAA,IAAA,sBAAA,EAAA,CAAA;AACA;;AAEA;AACA,IAAA,OAAA,IAAA,CAAA,QAAA,CAAA,GAAA,CAAA,GAAA,CAAA;AACA;AACA;;AAEA,MAAA,sBAAA,EAAA;AACA,GAAA,SAAA,CAAA,IAAA,EAAA,OAAA,EAAA;AACA,IAAA,OAAA,iBAAA,CAAA;AACA,MAAA,IAAA;AACA,MAAA,GAAA,OAAA;AACA,MAAA,UAAA,EAAA;AACA,QAAA,GAAA,OAAA,EAAA,UAAA;AACA,QAAA,0BAAA,EAAA,IAAA;AACA,OAAA;AACA,KAAA,CAAA;AACA;;AAEA;AACA;AACA;;AASA,GAAA,eAAA;AACA,IAAA,IAAA;AACA,IAAA,OAAA;AACA,IAAA,OAAA;AACA,IAAA,EAAA;AACA,IAAA;AACA,IAAA,MAAA,IAAA,IAAA,OAAA,OAAA,KAAA,QAAA,IAAA,OAAA,KAAA,IAAA,GAAA,OAAA,GAAA,EAAA,CAAA;;AAEA,IAAA,MAAA,QAAA,GAAA;AACA,MAAA,IAAA;AACA,MAAA,GAAA,IAAA;AACA,MAAA,UAAA,EAAA;AACA,QAAA,GAAA,IAAA,CAAA,UAAA;AACA,QAAA,0BAAA,EAAA,IAAA;AACA,OAAA;AACA,KAAA;;AAEA,IAAA,MAAA,QAAA;AACA,MAAA,OAAA,OAAA,KAAA;AACA,UAAA;AACA,UAAA,OAAA,OAAA,KAAA;AACA,YAAA;AACA,YAAA,OAAA,EAAA,KAAA;AACA,cAAA;AACA,cAAA,MAAA;AACA,KAAA;;AAEA;AACA,IAAA,OAAA,eAAA,CAAA,QAAA,EAAA,QAAA,CAAA;AACA;AACA;;;;"}
@@ -1 +1 @@
1
- {"type":"module","version":"9.40.0","sideEffects":false}
1
+ {"type":"module","version":"10.0.0-alpha.0","sideEffects":false}
@@ -1,6 +1,6 @@
1
1
  import type { Log, ParameterizedString } from '@sentry/core';
2
2
  /**
3
- * @summary Capture a log with the `trace` level. Requires `_experiments.enableLogs` to be enabled.
3
+ * @summary Capture a log with the `trace` level. Requires the `enableLogs` option to be enabled.
4
4
  *
5
5
  * @param message - The message to log.
6
6
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { userId: 100, route: '/dashboard' }.
@@ -26,7 +26,7 @@ import type { Log, ParameterizedString } from '@sentry/core';
26
26
  */
27
27
  export declare function trace(message: ParameterizedString, attributes?: Log['attributes']): void;
28
28
  /**
29
- * @summary Capture a log with the `debug` level. Requires `_experiments.enableLogs` to be enabled.
29
+ * @summary Capture a log with the `debug` level. Requires the `enableLogs` option to be enabled.
30
30
  *
31
31
  * @param message - The message to log.
32
32
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { component: 'Header', state: 'loading' }.
@@ -53,7 +53,7 @@ export declare function trace(message: ParameterizedString, attributes?: Log['at
53
53
  */
54
54
  export declare function debug(message: ParameterizedString, attributes?: Log['attributes']): void;
55
55
  /**
56
- * @summary Capture a log with the `info` level. Requires `_experiments.enableLogs` to be enabled.
56
+ * @summary Capture a log with the `info` level. Requires the `enableLogs` option to be enabled.
57
57
  *
58
58
  * @param message - The message to log.
59
59
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { feature: 'checkout', status: 'completed' }.
@@ -80,7 +80,7 @@ export declare function debug(message: ParameterizedString, attributes?: Log['at
80
80
  */
81
81
  export declare function info(message: ParameterizedString, attributes?: Log['attributes']): void;
82
82
  /**
83
- * @summary Capture a log with the `warn` level. Requires `_experiments.enableLogs` to be enabled.
83
+ * @summary Capture a log with the `warn` level. Requires the `enableLogs` option to be enabled.
84
84
  *
85
85
  * @param message - The message to log.
86
86
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { browser: 'Chrome', version: '91.0' }.
@@ -108,7 +108,7 @@ export declare function info(message: ParameterizedString, attributes?: Log['att
108
108
  */
109
109
  export declare function warn(message: ParameterizedString, attributes?: Log['attributes']): void;
110
110
  /**
111
- * @summary Capture a log with the `error` level. Requires `_experiments.enableLogs` to be enabled.
111
+ * @summary Capture a log with the `error` level. Requires the `enableLogs` option to be enabled.
112
112
  *
113
113
  * @param message - The message to log.
114
114
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { error: 'NetworkError', url: '/api/data' }.
@@ -137,7 +137,7 @@ export declare function warn(message: ParameterizedString, attributes?: Log['att
137
137
  */
138
138
  export declare function error(message: ParameterizedString, attributes?: Log['attributes']): void;
139
139
  /**
140
- * @summary Capture a log with the `fatal` level. Requires `_experiments.enableLogs` to be enabled.
140
+ * @summary Capture a log with the `fatal` level. Requires the `enableLogs` option to be enabled.
141
141
  *
142
142
  * @param message - The message to log.
143
143
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { appState: 'corrupted', sessionId: 'abc-123' }.
@@ -1,6 +1,6 @@
1
1
  import { Log, ParameterizedString } from '@sentry/core';
2
2
  /**
3
- * @summary Capture a log with the `trace` level. Requires `_experiments.enableLogs` to be enabled.
3
+ * @summary Capture a log with the `trace` level. Requires the `enableLogs` option to be enabled.
4
4
  *
5
5
  * @param message - The message to log.
6
6
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { userId: 100, route: '/dashboard' }.
@@ -26,7 +26,7 @@ import { Log, ParameterizedString } from '@sentry/core';
26
26
  */
27
27
  export declare function trace(message: ParameterizedString, attributes?: Log['attributes']): void;
28
28
  /**
29
- * @summary Capture a log with the `debug` level. Requires `_experiments.enableLogs` to be enabled.
29
+ * @summary Capture a log with the `debug` level. Requires the `enableLogs` option to be enabled.
30
30
  *
31
31
  * @param message - The message to log.
32
32
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { component: 'Header', state: 'loading' }.
@@ -53,7 +53,7 @@ export declare function trace(message: ParameterizedString, attributes?: Log['at
53
53
  */
54
54
  export declare function debug(message: ParameterizedString, attributes?: Log['attributes']): void;
55
55
  /**
56
- * @summary Capture a log with the `info` level. Requires `_experiments.enableLogs` to be enabled.
56
+ * @summary Capture a log with the `info` level. Requires the `enableLogs` option to be enabled.
57
57
  *
58
58
  * @param message - The message to log.
59
59
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { feature: 'checkout', status: 'completed' }.
@@ -80,7 +80,7 @@ export declare function debug(message: ParameterizedString, attributes?: Log['at
80
80
  */
81
81
  export declare function info(message: ParameterizedString, attributes?: Log['attributes']): void;
82
82
  /**
83
- * @summary Capture a log with the `warn` level. Requires `_experiments.enableLogs` to be enabled.
83
+ * @summary Capture a log with the `warn` level. Requires the `enableLogs` option to be enabled.
84
84
  *
85
85
  * @param message - The message to log.
86
86
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { browser: 'Chrome', version: '91.0' }.
@@ -108,7 +108,7 @@ export declare function info(message: ParameterizedString, attributes?: Log['att
108
108
  */
109
109
  export declare function warn(message: ParameterizedString, attributes?: Log['attributes']): void;
110
110
  /**
111
- * @summary Capture a log with the `error` level. Requires `_experiments.enableLogs` to be enabled.
111
+ * @summary Capture a log with the `error` level. Requires the `enableLogs` option to be enabled.
112
112
  *
113
113
  * @param message - The message to log.
114
114
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { error: 'NetworkError', url: '/api/data' }.
@@ -137,7 +137,7 @@ export declare function warn(message: ParameterizedString, attributes?: Log['att
137
137
  */
138
138
  export declare function error(message: ParameterizedString, attributes?: Log['attributes']): void;
139
139
  /**
140
- * @summary Capture a log with the `fatal` level. Requires `_experiments.enableLogs` to be enabled.
140
+ * @summary Capture a log with the `fatal` level. Requires the `enableLogs` option to be enabled.
141
141
  *
142
142
  * @param message - The message to log.
143
143
  * @param attributes - Arbitrary structured data that stores information about the log - e.g., { appState: 'corrupted', sessionId: 'abc-123' }.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/cloudflare",
3
- "version": "9.40.0",
3
+ "version": "10.0.0-alpha.0",
4
4
  "description": "Official Sentry SDK for Cloudflare Workers and Pages",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/cloudflare",
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@opentelemetry/api": "^1.9.0",
53
- "@sentry/core": "9.40.0"
53
+ "@sentry/core": "10.0.0-alpha.0"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@cloudflare/workers-types": "^4.x"