@sentry/cloudflare 11.0.0-rc.1 → 11.0.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.
Files changed (71) hide show
  1. package/build/cjs/dev/client.js +11 -4
  2. package/build/cjs/dev/client.js.map +1 -1
  3. package/build/cjs/dev/instrumentations/worker/instrumentQueueProducer.js +2 -1
  4. package/build/cjs/dev/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
  5. package/build/cjs/dev/transport.js +18 -4
  6. package/build/cjs/dev/transport.js.map +1 -1
  7. package/build/cjs/dev/vite/flueRuntime.js +6 -35
  8. package/build/cjs/dev/vite/flueRuntime.js.map +1 -1
  9. package/build/cjs/dev/vite/mastraObservability.js +6 -30
  10. package/build/cjs/dev/vite/mastraObservability.js.map +1 -1
  11. package/build/cjs/dev/vite/providedModulePlugin.js +53 -0
  12. package/build/cjs/dev/vite/providedModulePlugin.js.map +1 -0
  13. package/build/cjs/dev/workflows.js +7 -2
  14. package/build/cjs/dev/workflows.js.map +1 -1
  15. package/build/cjs/prod/client.js +11 -4
  16. package/build/cjs/prod/client.js.map +1 -1
  17. package/build/cjs/prod/instrumentations/worker/instrumentQueueProducer.js +2 -1
  18. package/build/cjs/prod/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
  19. package/build/cjs/prod/transport.js +18 -4
  20. package/build/cjs/prod/transport.js.map +1 -1
  21. package/build/cjs/prod/vite/flueRuntime.js +6 -35
  22. package/build/cjs/prod/vite/flueRuntime.js.map +1 -1
  23. package/build/cjs/prod/vite/mastraObservability.js +6 -30
  24. package/build/cjs/prod/vite/mastraObservability.js.map +1 -1
  25. package/build/cjs/prod/vite/providedModulePlugin.js +53 -0
  26. package/build/cjs/prod/vite/providedModulePlugin.js.map +1 -0
  27. package/build/cjs/prod/workflows.js +7 -2
  28. package/build/cjs/prod/workflows.js.map +1 -1
  29. package/build/esm/dev/client.js +11 -4
  30. package/build/esm/dev/client.js.map +1 -1
  31. package/build/esm/dev/instrumentations/worker/instrumentQueueProducer.js +2 -1
  32. package/build/esm/dev/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
  33. package/build/esm/dev/package.json +1 -1
  34. package/build/esm/dev/transport.js +19 -5
  35. package/build/esm/dev/transport.js.map +1 -1
  36. package/build/esm/dev/vite/flueRuntime.js +7 -35
  37. package/build/esm/dev/vite/flueRuntime.js.map +1 -1
  38. package/build/esm/dev/vite/mastraObservability.js +7 -30
  39. package/build/esm/dev/vite/mastraObservability.js.map +1 -1
  40. package/build/esm/dev/vite/providedModulePlugin.js +50 -0
  41. package/build/esm/dev/vite/providedModulePlugin.js.map +1 -0
  42. package/build/esm/dev/workflows.js +7 -2
  43. package/build/esm/dev/workflows.js.map +1 -1
  44. package/build/esm/prod/client.js +11 -4
  45. package/build/esm/prod/client.js.map +1 -1
  46. package/build/esm/prod/instrumentations/worker/instrumentQueueProducer.js +2 -1
  47. package/build/esm/prod/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
  48. package/build/esm/prod/package.json +1 -1
  49. package/build/esm/prod/transport.js +19 -5
  50. package/build/esm/prod/transport.js.map +1 -1
  51. package/build/esm/prod/vite/flueRuntime.js +7 -35
  52. package/build/esm/prod/vite/flueRuntime.js.map +1 -1
  53. package/build/esm/prod/vite/mastraObservability.js +7 -30
  54. package/build/esm/prod/vite/mastraObservability.js.map +1 -1
  55. package/build/esm/prod/vite/providedModulePlugin.js +50 -0
  56. package/build/esm/prod/vite/providedModulePlugin.js.map +1 -0
  57. package/build/esm/prod/workflows.js +7 -2
  58. package/build/esm/prod/workflows.js.map +1 -1
  59. package/build/types/client.d.ts +5 -3
  60. package/build/types/client.d.ts.map +1 -1
  61. package/build/types/instrumentations/worker/instrumentQueueProducer.d.ts.map +1 -1
  62. package/build/types/transport.d.ts +5 -0
  63. package/build/types/transport.d.ts.map +1 -1
  64. package/build/types/vite/flueRuntime.d.ts +2 -13
  65. package/build/types/vite/flueRuntime.d.ts.map +1 -1
  66. package/build/types/vite/mastraObservability.d.ts +8 -23
  67. package/build/types/vite/mastraObservability.d.ts.map +1 -1
  68. package/build/types/vite/providedModulePlugin.d.ts +62 -0
  69. package/build/types/vite/providedModulePlugin.d.ts.map +1 -0
  70. package/build/types/workflows.d.ts.map +1 -1
  71. package/package.json +4 -4
@@ -0,0 +1,50 @@
1
+ import { resolve } from 'node:path';
2
+ import MagicString from 'magic-string';
3
+
4
+ function createIntegrationModuleMatcher(integrationModule) {
5
+ const suffix = `@sentry/server-utils/build/esm/integrations/${integrationModule}.js`;
6
+ return (id) => id.replace(/\\/g, "/").replace(/[?#].*$/, "").endsWith(suffix);
7
+ }
8
+ function buildProviderSnippet({ moduleName, identifier }) {
9
+ const marker = "globalThis.__SENTRY_ORCHESTRION__";
10
+ return `import * as ${identifier} from '${moduleName}';
11
+ (${marker} = ${marker} || {});
12
+ (${marker}.providedModules = ${marker}.providedModules || {});
13
+ Object.defineProperty(${marker}.providedModules, '${moduleName}', { configurable: true, enumerable: true, get() { return ${identifier}; } });
14
+ `;
15
+ }
16
+ function createProvidedModulePlugin(options) {
17
+ const isIntegrationModuleId = createIntegrationModuleMatcher(options.integrationModule);
18
+ let root = process.cwd();
19
+ let providerSnippet;
20
+ return {
21
+ name: options.name,
22
+ applyToEnvironment(environment) {
23
+ return environment.config.consumer === "server";
24
+ },
25
+ configResolved(config) {
26
+ root = config.root;
27
+ },
28
+ async buildStart() {
29
+ if (providerSnippet) return;
30
+ try {
31
+ const resolved = await this.resolve(options.moduleName, resolve(root, "noop.js"));
32
+ if (!resolved) return;
33
+ } catch (error) {
34
+ this.warn(
35
+ `[Sentry] could not resolve ${options.moduleName} while probing for it; injecting the provider anyway. ${error?.message ?? error}`
36
+ );
37
+ }
38
+ providerSnippet = buildProviderSnippet(options);
39
+ },
40
+ transform(code, id) {
41
+ if (!providerSnippet || !isIntegrationModuleId(id) || code.includes(options.identifier)) return void 0;
42
+ const ms = new MagicString(code);
43
+ ms.prepend(providerSnippet);
44
+ return { code: ms.toString(), map: ms.generateMap({ hires: true }) };
45
+ }
46
+ };
47
+ }
48
+
49
+ export { createIntegrationModuleMatcher, createProvidedModulePlugin };
50
+ //# sourceMappingURL=providedModulePlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providedModulePlugin.js","sources":["../../../../src/vite/providedModulePlugin.ts"],"sourcesContent":["import { resolve } from 'node:path';\nimport MagicString from 'magic-string';\n\n/**\n * The slice of the Rollup plugin context the probe needs. Declared here rather than imported so\n * this file carries no Rollup or Vite type dependency.\n */\ninterface ResolveContext {\n resolve(\n source: string,\n importer?: string,\n options?: { skipSelf?: boolean },\n ): Promise<{ id: string; external?: boolean | string } | null>;\n warn(message: string): void;\n}\n\n/** The plugin shape `sentryCloudflareVitePlugin` composes. */\nexport interface ProvidedModulePlugin {\n name: string;\n applyToEnvironment(environment: { config: { consumer: string } }): boolean;\n configResolved(config: { root: string }): void;\n buildStart(this: ResolveContext): Promise<void>;\n transform(code: string, id: string): { code: string; map: ReturnType<MagicString['generateMap']> } | undefined;\n}\n\nexport interface ProvidedModulePluginOptions {\n /** Vite plugin name, e.g. `sentry-cloudflare-flue-runtime-provider`. */\n name: string;\n /** Bare specifier of the package to provide, e.g. `@flue/runtime`. */\n moduleName: string;\n /** Namespace binding the injected import uses, e.g. `__SENTRY_FLUE_RUNTIME__`. */\n identifier: string;\n /** Basename of the `@sentry/server-utils` integration module to inject into, e.g. `flue`. */\n integrationModule: string;\n}\n\n/**\n * Build the matcher for one `@sentry/server-utils` integration module.\n *\n * Plain `endsWith`, not a `RegExp`: nothing here needs pattern matching, and building one from\n * a caller-supplied string would need escaping, which is the only reason this file would have to\n * import from `@sentry/core`. A build-time plugin should not drag the SDK into the build.\n */\nexport function createIntegrationModuleMatcher(integrationModule: string): (id: string) => boolean {\n // The ESM build only: a worker never loads the CJS one.\n const suffix = `@sentry/server-utils/build/esm/integrations/${integrationModule}.js`;\n\n return (id: string): boolean =>\n id\n .replace(/\\\\/g, '/')\n .replace(/[?#].*$/, '')\n .endsWith(suffix);\n}\n\nfunction buildProviderSnippet({ moduleName, identifier }: ProvidedModulePluginOptions): string {\n const marker = 'globalThis.__SENTRY_ORCHESTRION__';\n\n // A getter, not an assignment: assigning reads the binding at injection time, so it stores\n // `undefined` whenever the bundler evaluates Sentry's module before the provided package\n // finished initializing. Enumerable so the entry shows up in `Object.keys` and a spread.\n return (\n `import * as ${identifier} from '${moduleName}';\\n` +\n `(${marker} = ${marker} || {});\\n` +\n `(${marker}.providedModules = ${marker}.providedModules || {});\\n` +\n `Object.defineProperty(${marker}.providedModules, '${moduleName}', ` +\n `{ configurable: true, enumerable: true, get() { return ${identifier}; } });\\n`\n );\n}\n\n/**\n * Build a Vite plugin that splices a static `import * as … from '<moduleName>'` into one of\n * Sentry's own integration modules and exposes the namespace on the global orchestrion marker.\n *\n * Some packages are instrumented by registration rather than by patching, so instrumenting them\n * needs a reference to that module's own binding and no channel payload carries one. On Node the\n * integration resolves it itself; a bundled worker has no `node_modules` to resolve from, so the\n * binding is supplied at build time instead. The import is static, lands in Sentry's module rather\n * than the user's code, and is only emitted when the package actually resolves.\n */\nexport function createProvidedModulePlugin(options: ProvidedModulePluginOptions): ProvidedModulePlugin {\n const isIntegrationModuleId = createIntegrationModuleMatcher(options.integrationModule);\n\n let root = process.cwd();\n let providerSnippet: string | undefined;\n\n return {\n name: options.name,\n\n applyToEnvironment(environment: { config: { consumer: string } }): boolean {\n // Server environments only. `buildStart` runs per environment against one shared plugin\n // instance, so without this a `client` build resolves first, under browser conditions, and\n // answers on the worker's behalf. That defeats the point of probing with `this.resolve`.\n // Same gate the orchestrion plugin uses.\n return environment.config.consumer === 'server';\n },\n\n configResolved(config: { root: string }): void {\n root = config.root;\n },\n\n async buildStart(this: ResolveContext): Promise<void> {\n // Already answered by an earlier server environment. A build with several worker\n // environments shares the answer: they resolve under the same conditions.\n if (providerSnippet) return;\n\n try {\n // The environment's own resolver, so the probe uses the conditions the injected import\n // will. That is what a `require.resolve` probe cannot do: an ESM-only package has no\n // `require` condition and reads as missing. Resolved from the app root, not from Sentry's\n // own install.\n const resolved = await this.resolve(options.moduleName, resolve(root, 'noop.js'));\n if (!resolved) return;\n } catch (error) {\n // Present but unresolvable for some other reason. Inject anyway so the build fails loudly\n // rather than silently shipping a worker with no instrumentation, and surface the original\n // cause: the import error Vite raises next says nothing about why resolution broke.\n this.warn(\n `[Sentry] could not resolve ${options.moduleName} while probing for it; injecting the provider anyway. ${\n (error as Error | undefined)?.message ?? error\n }`,\n );\n }\n\n providerSnippet = buildProviderSnippet(options);\n },\n\n transform(code: string, id: string): { code: string; map: ReturnType<MagicString['generateMap']> } | undefined {\n // `code.includes` keeps this idempotent: a second pass over already-injected output would\n // otherwise emit a duplicate `import * as` binding, which is a syntax error.\n if (!providerSnippet || !isIntegrationModuleId(id) || code.includes(options.identifier)) return undefined;\n\n const ms = new MagicString(code);\n ms.prepend(providerSnippet);\n return { code: ms.toString(), map: ms.generateMap({ hires: true }) };\n },\n };\n}\n"],"names":[],"mappings":";;;AA2CO,SAAS,+BAA+B,iBAAA,EAAoD;AAEjG,EAAA,MAAM,MAAA,GAAS,+CAA+C,iBAAiB,CAAA,GAAA,CAAA;AAE/E,EAAA,OAAO,CAAC,EAAA,KACN,EAAA,CACG,OAAA,CAAQ,KAAA,EAAO,GAAG,CAAA,CAClB,OAAA,CAAQ,SAAA,EAAW,EAAE,CAAA,CACrB,QAAA,CAAS,MAAM,CAAA;AACtB;AAEA,SAAS,oBAAA,CAAqB,EAAE,UAAA,EAAY,UAAA,EAAW,EAAwC;AAC7F,EAAA,MAAM,MAAA,GAAS,mCAAA;AAKf,EAAA,OACE,CAAA,YAAA,EAAe,UAAU,CAAA,OAAA,EAAU,UAAU,CAAA;AAAA,CAAA,EACzC,MAAM,MAAM,MAAM,CAAA;AAAA,CAAA,EAClB,MAAM,sBAAsB,MAAM,CAAA;AAAA,sBAAA,EACb,MAAM,CAAA,mBAAA,EAAsB,UAAU,CAAA,0DAAA,EACL,UAAU,C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AAC1B,MAAA,OAAO,EAAE,IAAA,EAAM,EAAA,CAAG,QAAA,EAAS,EAAG,GAAA,EAAK,EAAA,CAAG,WAAA,CAAY,EAAE,KAAA,EAAO,IAAA,EAAM,CAAA,EAAE;AAAA,IACrE;AAAA,GACF;AACF;;;;"}
@@ -8,6 +8,7 @@ import { instrumentEnv } from './instrumentations/worker/instrumentEnv.js';
8
8
  import { addCloudResourceContext } from './scope-utils.js';
9
9
  import { init } from './sdk.js';
10
10
  import { instrumentContext } from './utils/instrumentContext.js';
11
+ import { getInvocationState } from './utils/invocationContext.js';
11
12
  import { withInvocationIsolationScope } from './utils/invocationScope.js';
12
13
 
13
14
  const UUID_REGEX = /^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$/i;
@@ -44,6 +45,10 @@ class WrappedWorkflowStep {
44
45
  const hasStepContext = typeof attempt === "number" && typeof retryLimit === "number";
45
46
  const isFinalAttempt = !hasStepContext || attempt > retryLimit;
46
47
  return withIsolationScope(this._isolationScope, () => {
48
+ const invocationState = getInvocationState();
49
+ if (invocationState) {
50
+ invocationState.flushPointReached = false;
51
+ }
47
52
  const stepResult = startSpan(
48
53
  {
49
54
  name,
@@ -77,11 +82,11 @@ class WrappedWorkflowStep {
77
82
  );
78
83
  return stepResult.then(
79
84
  (result) => {
80
- this._waitUntil(flush(2e3));
85
+ this._waitUntil(withScope(scopeForStep, () => flush(2e3)));
81
86
  return result;
82
87
  },
83
88
  (error) => {
84
- this._waitUntil(flush(2e3));
89
+ this._waitUntil(withScope(scopeForStep, () => flush(2e3)));
85
90
  throw error;
86
91
  }
87
92
  );
@@ -1 +1 @@
1
- {"version":3,"file":"workflows.js","sources":["../../../src/workflows.ts"],"sourcesContent":["import { SENTRY_SEGMENT_NAME_SOURCE, CODE_FUNCTION_NAME, SENTRY_OP } from '@sentry/conventions/attributes';\nimport { FUNCTION } from '@sentry/conventions/op';\nimport type { PropagationContext, Scope } from '@sentry/core';\nimport {\n captureException,\n flush,\n getCurrentScope,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n startSpan,\n withIsolationScope,\n withScope,\n} from '@sentry/core';\nimport type {\n WorkflowDelayDuration,\n WorkflowEntrypoint,\n WorkflowEvent,\n WorkflowSleepDuration,\n WorkflowStep,\n WorkflowStepConfig,\n WorkflowStepContext,\n WorkflowStepEvent,\n WorkflowStepRollbackOptions,\n WorkflowTimeoutDuration,\n} from 'cloudflare:workers';\nimport { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/no-diagnostic-channels';\nimport type { CloudflareOptions } from './client';\nimport { flushAndDispose, getOriginalWaitUntil } from './flush';\nimport { markAsInstrumented } from './instrument';\nimport { instrumentEnv } from './instrumentations/worker/instrumentEnv';\nimport { addCloudResourceContext } from './scope-utils';\nimport { init } from './sdk';\nimport { instrumentContext } from './utils/instrumentContext';\nimport type { DefaultEnv, ResolveEnv, StrictCloudflareOptions } from './types';\nimport { withInvocationIsolationScope } from './utils/invocationScope';\n\nconst UUID_REGEX = /^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$/i;\n\n/**\n * Hashes a string to a UUID using SHA-1.\n */\nexport async function deterministicTraceIdFromInstanceId(instanceId: string): Promise<string> {\n const buf = await crypto.subtle.digest('SHA-1', new TextEncoder().encode(instanceId));\n return (\n Array.from(new Uint8Array(buf))\n // We only need the first 16 bytes for the 32 characters\n .slice(0, 16)\n .map(b => b.toString(16).padStart(2, '0'))\n .join('')\n );\n}\n\nasync function propagationContextFromInstanceId(instanceId: string): Promise<PropagationContext> {\n const traceId = UUID_REGEX.test(instanceId)\n ? instanceId.replace(/-/g, '')\n : await deterministicTraceIdFromInstanceId(instanceId);\n\n // Derive sampleRand from last 4 characters of the random UUID\n //\n // We cannot store any state between workflow steps, so we derive the\n // sampleRand from the traceId itself. This ensures that the sampling is\n // consistent across all steps in the same workflow instance.\n const sampleRand = parseInt(traceId.slice(-4), 16) / 0xffff;\n\n return {\n traceId,\n sampleRand,\n };\n}\n\nclass WrappedWorkflowStep implements WorkflowStep {\n public constructor(\n private _instanceId: string,\n private _options: CloudflareOptions,\n private _step: WorkflowStep,\n private _waitUntil: ExecutionContext['waitUntil'],\n private _isolationScope: Scope,\n ) {}\n\n public async do<T extends Rpc.Serializable<T>>(\n name: string,\n callback: (ctx: WorkflowStepContext) => Promise<T>,\n rollbackOptions?: WorkflowStepRollbackOptions<T>,\n ): Promise<T>;\n public async do<T extends Rpc.Serializable<T>, const C extends WorkflowStepConfig>(\n name: string,\n config: C,\n callback: (\n ctx: WorkflowStepContext<C['retries'] extends { delay: infer D } ? D : WorkflowDelayDuration | number>,\n ) => Promise<T>,\n rollbackOptions?: WorkflowStepRollbackOptions<T>,\n ): Promise<T>;\n public async do<T extends Rpc.Serializable<T>>(\n name: string,\n configOrCallback: WorkflowStepConfig | ((ctx: WorkflowStepContext) => Promise<T>),\n callbackOrRollback?: ((ctx: WorkflowStepContext) => Promise<T>) | WorkflowStepRollbackOptions<T>,\n maybeRollback?: WorkflowStepRollbackOptions<T>,\n ): Promise<T> {\n // Capture the current scope, so parent span (e.g., a startSpan surrounding step.do) is preserved\n const scopeForStep = getCurrentScope();\n\n const hasConfig = typeof configOrCallback !== 'function';\n const config = hasConfig ? configOrCallback : undefined;\n const userCallback = (hasConfig ? callbackOrRollback : configOrCallback) as (\n ctx: WorkflowStepContext,\n ) => Promise<T>;\n const rollbackOptions = (hasConfig ? maybeRollback : callbackOrRollback) as\n | WorkflowStepRollbackOptions<T>\n | undefined;\n\n const instrumentedCallback = async (...args: unknown[]): Promise<T> => {\n // Feature detection: Cloudflare Workflows (April 2026+) pass a step context\n // with `attempt` and `config.retries.limit`. When available, we only capture\n // errors on the final attempt to avoid duplicates during retries.\n const stepContext = args[0] as { attempt?: number; config?: { retries?: { limit?: number } } } | undefined;\n const attempt = stepContext?.attempt;\n const retryLimit = stepContext?.config?.retries?.limit;\n const hasStepContext = typeof attempt === 'number' && typeof retryLimit === 'number';\n\n // Only capture error on final attempt (attempt > retryLimit means no more retries left)\n // or when step context is unavailable (legacy behavior - capture all errors)\n const isFinalAttempt = !hasStepContext || attempt > retryLimit;\n\n // The engine invokes step callbacks outside the async context of `run`, so the\n // run's isolation scope (and with it the invocation state that ties eager sends\n // to this invocation's `waitUntil`) has to be restored explicitly.\n return withIsolationScope(this._isolationScope, () => {\n const stepResult = startSpan(\n {\n name,\n scope: scopeForStep,\n attributes: {\n [SENTRY_OP]: FUNCTION,\n [CODE_FUNCTION_NAME]: name,\n 'workflow.step.name': name,\n 'cloudflare.workflow.timeout': config?.timeout,\n 'cloudflare.workflow.retries.backoff': config?.retries?.backoff,\n // In workers-types v5, `delay` may be a `WorkflowDelayFunction`, which isn't a valid span attribute value.\n 'cloudflare.workflow.retries.delay':\n typeof config?.retries?.delay === 'function' ? undefined : config?.retries?.delay,\n 'cloudflare.workflow.retries.limit': config?.retries?.limit,\n 'cloudflare.workflow.attempt': attempt,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.faas.cloudflare.workflow',\n [SENTRY_SEGMENT_NAME_SOURCE]: 'task',\n },\n },\n async span => {\n try {\n const result = await (userCallback as (...args: unknown[]) => Promise<T>)(...args);\n span.setStatus({ code: 1 });\n return result;\n } catch (error) {\n if (isFinalAttempt) {\n captureException(error, { mechanism: { handled: true, type: 'auto.faas.cloudflare.workflow' } });\n }\n throw error;\n }\n },\n );\n // Deliver after the step span has ended, so the span rides this flush instead of\n // starting an eager drain (same ordering as `wrapMethodWithSentry`'s teardown).\n return stepResult.then(\n result => {\n this._waitUntil(flush(2000));\n return result;\n },\n error => {\n this._waitUntil(flush(2000));\n throw error;\n },\n );\n });\n };\n\n if (config) {\n return rollbackOptions\n ? this._step.do(name, config, instrumentedCallback, rollbackOptions)\n : this._step.do(name, config, instrumentedCallback);\n }\n\n return rollbackOptions\n ? this._step.do(name, instrumentedCallback, rollbackOptions)\n : this._step.do(name, instrumentedCallback);\n }\n\n public async sleep(name: string, duration: WorkflowSleepDuration): Promise<void> {\n return this._step.sleep(name, duration);\n }\n\n public async sleepUntil(name: string, timestamp: Date | number): Promise<void> {\n return this._step.sleepUntil(name, timestamp);\n }\n\n public async waitForEvent<T extends Rpc.Serializable<T>>(\n name: string,\n options: { type: string; timeout?: WorkflowTimeoutDuration | number },\n ): Promise<WorkflowStepEvent<T>> {\n return this._step.waitForEvent<T>(name, options);\n }\n}\n\n/**\n * Instruments a Cloudflare Workflow class with Sentry.\n *\n * @example\n * ```typescript\n * const InstrumentedWorkflow = instrumentWorkflowWithSentry(\n * (env) => ({ dsn: env.SENTRY_DSN }),\n * MyWorkflowClass\n * );\n *\n * export default InstrumentedWorkflow;\n * ```\n *\n * @param optionsCallback - Function that returns Sentry options to initialize Sentry\n * @param WorkflowClass - The workflow class to instrument\n * @returns Instrumented workflow class with the same interface\n */\nexport function instrumentWorkflowWithSentry<\n E = DefaultEnv, // Environment type\n P = unknown, // Payload type\n // oxlint-disable-next-line typescript/no-explicit-any\n T extends WorkflowEntrypoint<any, any> = WorkflowEntrypoint<E, P>, // WorkflowEntrypoint type\n // The constraint must not route through `T`: workers-types defaults `WorkflowEntrypoint`'s\n // `Env` to `unknown` (unlike `WorkerEntrypoint`/`DurableObject`, which default to\n // `Cloudflare.Env`), so a bare subclass would be rejected in a `wrangler types` project.\n // The callback env is resolved from the inferred constructor via `ResolveEnv` instead.\n // oxlint-disable-next-line typescript/no-explicit-any\n C extends new (ctx: ExecutionContext, env: any) => WorkflowEntrypoint<any, any> = new (\n ctx: ExecutionContext,\n // oxlint-disable-next-line typescript/no-explicit-any\n env: any,\n ) => T, // Constructor type of the WorkflowEntrypoint class\n O = unknown,\n>(optionsCallback: (env: ResolveEnv<C, E>) => StrictCloudflareOptions<O>, WorkFlowClass: C): C {\n const InstrumentedClass = new Proxy(WorkFlowClass, {\n // oxlint-disable-next-line typescript/no-explicit-any\n construct(target: C, args: [ctx: ExecutionContext, env: any], newTarget) {\n const [ctx, env] = args;\n const context = instrumentContext(ctx);\n const options = optionsCallback(env);\n args[0] = context;\n args[1] = instrumentEnv(env as Record<string, unknown>, options) as E;\n const instance = Reflect.construct(target, args, newTarget) as T;\n return new Proxy(instance, {\n get(obj, prop, receiver) {\n if (prop === 'run') {\n return async function (event: WorkflowEvent<P>, step: WorkflowStep): Promise<unknown> {\n setAsyncLocalStorageAsyncContextStrategy();\n\n return withInvocationIsolationScope(async isolationScope => {\n const waitUntil = getOriginalWaitUntil(context).bind(context);\n const client = init({ ...options, ctx: context, enableDedupe: false });\n isolationScope.setClient(client);\n\n addCloudResourceContext(isolationScope);\n\n return withScope(async scope => {\n const propagationContext = await propagationContextFromInstanceId(event.instanceId);\n scope.setPropagationContext(propagationContext);\n\n try {\n return await obj.run.call(\n obj,\n event,\n new WrappedWorkflowStep(event.instanceId, options, step, waitUntil, isolationScope),\n );\n } finally {\n waitUntil(flushAndDispose(client));\n }\n });\n }, context);\n };\n }\n return Reflect.get(obj, prop, receiver);\n },\n });\n },\n });\n // Recognizable for `_INTERNAL_wrapUnlessInstrumented`, so auto-instrumentation never nests wrappers.\n markAsInstrumented(InstrumentedClass);\n return InstrumentedClass;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAmCA,MAAM,UAAA,GAAa,qEAAA;AAKnB,eAAsB,mCAAmC,UAAA,EAAqC;AAC5F,EAAA,MAAM,GAAA,GAAM,MAAM,MAAA,CAAO,MAAA,CAAO,MAAA,CAAO,OAAA,EAAS,IAAI,WAAA,EAAY,CAAE,MAAA,CAAO,UAAU,CAAC,CAAA;AACpF,EAAA,OACE,KAAA,CAAM,KAAK,IAAI,UAAA,CAAW,GAAG,CAAC,CAAA,CAE3B,KAAA,CAAM,CAAA,EAAG,EAAE,CAAA,CACX,IAAI,CAAA,CAAA,KAAK,CAAA,CAAE,QAAA,CAAS,EAAE,CAAA,CAAE,QAAA,CAAS,GAAG,GAAG,CAAC,CAAA,CACxC,IAAA,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A,GAAqB,MAAM,gCAAA,CAAiC,KAAA,CAAM,UAAU,CAAA;AAClF,kBAAA,KAAA,CAAM,sBAAsB,kBAAkB,CAAA;AAE9C,kBAAA,IAAI;AACF,oBAAA,OAAO,MAAM,IAAI,GAAA,CAAI,IAAA;AAAA,sBACnB,GAAA;AAAA,sBACA,KAAA;AAAA,sBACA,IAAI,mBAAA,CAAoB,KAAA,CAAM,YAAY,OAAA,EAAS,IAAA,EAAM,WAAW,cAAc;AAAA,qBACpF;AAAA,kBACF,CAAA,SAAE;AACA,oBAAA,SAAA,CAAU,eAAA,CAAgB,MAAM,CAAC,CAAA;AAAA,kBACnC;AAAA,gBACF,CAAC,CAAA;AAAA,cACH,GAAG,OAAO,CAAA;AAAA,YACZ,CAAA;AAAA,UACF;AACA,UAAA,OAAO,OAAA,CAAQ,GAAA,CAAI,GAAA,EAAK,IAAA,EAAM,QAAQ,CAAA;AAAA,QACxC;AAAA,OACD,CAAA;AAAA,IACH;AAAA,GACD,CAAA;AAED,EAAA,kBAAA,CAAmB,iBAAiB,CAAA;AACpC,EAAA,OAAO,iBAAA;AACT;;;;"}
1
+ {"version":3,"file":"workflows.js","sources":["../../../src/workflows.ts"],"sourcesContent":["import { SENTRY_SEGMENT_NAME_SOURCE, CODE_FUNCTION_NAME, SENTRY_OP } from '@sentry/conventions/attributes';\nimport { FUNCTION } from '@sentry/conventions/op';\nimport type { PropagationContext, Scope } from '@sentry/core';\nimport {\n captureException,\n flush,\n getCurrentScope,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n startSpan,\n withIsolationScope,\n withScope,\n} from '@sentry/core';\nimport type {\n WorkflowDelayDuration,\n WorkflowEntrypoint,\n WorkflowEvent,\n WorkflowSleepDuration,\n WorkflowStep,\n WorkflowStepConfig,\n WorkflowStepContext,\n WorkflowStepEvent,\n WorkflowStepRollbackOptions,\n WorkflowTimeoutDuration,\n} from 'cloudflare:workers';\nimport { setAsyncLocalStorageAsyncContextStrategy } from '@sentry/server-utils/no-diagnostic-channels';\nimport type { CloudflareOptions } from './client';\nimport { flushAndDispose, getOriginalWaitUntil } from './flush';\nimport { markAsInstrumented } from './instrument';\nimport { instrumentEnv } from './instrumentations/worker/instrumentEnv';\nimport { addCloudResourceContext } from './scope-utils';\nimport { init } from './sdk';\nimport { instrumentContext } from './utils/instrumentContext';\nimport type { DefaultEnv, ResolveEnv, StrictCloudflareOptions } from './types';\nimport { getInvocationState } from './utils/invocationContext';\nimport { withInvocationIsolationScope } from './utils/invocationScope';\n\nconst UUID_REGEX = /^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$/i;\n\n/**\n * Hashes a string to a UUID using SHA-1.\n */\nexport async function deterministicTraceIdFromInstanceId(instanceId: string): Promise<string> {\n const buf = await crypto.subtle.digest('SHA-1', new TextEncoder().encode(instanceId));\n return (\n Array.from(new Uint8Array(buf))\n // We only need the first 16 bytes for the 32 characters\n .slice(0, 16)\n .map(b => b.toString(16).padStart(2, '0'))\n .join('')\n );\n}\n\nasync function propagationContextFromInstanceId(instanceId: string): Promise<PropagationContext> {\n const traceId = UUID_REGEX.test(instanceId)\n ? instanceId.replace(/-/g, '')\n : await deterministicTraceIdFromInstanceId(instanceId);\n\n // Derive sampleRand from last 4 characters of the random UUID\n //\n // We cannot store any state between workflow steps, so we derive the\n // sampleRand from the traceId itself. This ensures that the sampling is\n // consistent across all steps in the same workflow instance.\n const sampleRand = parseInt(traceId.slice(-4), 16) / 0xffff;\n\n return {\n traceId,\n sampleRand,\n };\n}\n\nclass WrappedWorkflowStep implements WorkflowStep {\n public constructor(\n private _instanceId: string,\n private _options: CloudflareOptions,\n private _step: WorkflowStep,\n private _waitUntil: ExecutionContext['waitUntil'],\n private _isolationScope: Scope,\n ) {}\n\n public async do<T extends Rpc.Serializable<T>>(\n name: string,\n callback: (ctx: WorkflowStepContext) => Promise<T>,\n rollbackOptions?: WorkflowStepRollbackOptions<T>,\n ): Promise<T>;\n public async do<T extends Rpc.Serializable<T>, const C extends WorkflowStepConfig>(\n name: string,\n config: C,\n callback: (\n ctx: WorkflowStepContext<C['retries'] extends { delay: infer D } ? D : WorkflowDelayDuration | number>,\n ) => Promise<T>,\n rollbackOptions?: WorkflowStepRollbackOptions<T>,\n ): Promise<T>;\n public async do<T extends Rpc.Serializable<T>>(\n name: string,\n configOrCallback: WorkflowStepConfig | ((ctx: WorkflowStepContext) => Promise<T>),\n callbackOrRollback?: ((ctx: WorkflowStepContext) => Promise<T>) | WorkflowStepRollbackOptions<T>,\n maybeRollback?: WorkflowStepRollbackOptions<T>,\n ): Promise<T> {\n // Capture the current scope, so parent span (e.g., a startSpan surrounding step.do) is preserved\n const scopeForStep = getCurrentScope();\n\n const hasConfig = typeof configOrCallback !== 'function';\n const config = hasConfig ? configOrCallback : undefined;\n const userCallback = (hasConfig ? callbackOrRollback : configOrCallback) as (\n ctx: WorkflowStepContext,\n ) => Promise<T>;\n const rollbackOptions = (hasConfig ? maybeRollback : callbackOrRollback) as\n | WorkflowStepRollbackOptions<T>\n | undefined;\n\n const instrumentedCallback = async (...args: unknown[]): Promise<T> => {\n // Feature detection: Cloudflare Workflows (April 2026+) pass a step context\n // with `attempt` and `config.retries.limit`. When available, we only capture\n // errors on the final attempt to avoid duplicates during retries.\n const stepContext = args[0] as { attempt?: number; config?: { retries?: { limit?: number } } } | undefined;\n const attempt = stepContext?.attempt;\n const retryLimit = stepContext?.config?.retries?.limit;\n const hasStepContext = typeof attempt === 'number' && typeof retryLimit === 'number';\n\n // Only capture error on final attempt (attempt > retryLimit means no more retries left)\n // or when step context is unavailable (legacy behavior - capture all errors)\n const isFinalAttempt = !hasStepContext || attempt > retryLimit;\n\n // The engine invokes step callbacks outside the async context of `run`, so the\n // run's isolation scope (and with it the invocation state that ties eager sends\n // to this invocation's `waitUntil`) has to be restored explicitly.\n return withIsolationScope(this._isolationScope, () => {\n const invocationState = getInvocationState();\n\n if (invocationState) {\n invocationState.flushPointReached = false;\n }\n\n const stepResult = startSpan(\n {\n name,\n scope: scopeForStep,\n attributes: {\n [SENTRY_OP]: FUNCTION,\n [CODE_FUNCTION_NAME]: name,\n 'workflow.step.name': name,\n 'cloudflare.workflow.timeout': config?.timeout,\n 'cloudflare.workflow.retries.backoff': config?.retries?.backoff,\n // In workers-types v5, `delay` may be a `WorkflowDelayFunction`, which isn't a valid span attribute value.\n 'cloudflare.workflow.retries.delay':\n typeof config?.retries?.delay === 'function' ? undefined : config?.retries?.delay,\n 'cloudflare.workflow.retries.limit': config?.retries?.limit,\n 'cloudflare.workflow.attempt': attempt,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.faas.cloudflare.workflow',\n [SENTRY_SEGMENT_NAME_SOURCE]: 'task',\n },\n },\n async span => {\n try {\n const result = await (userCallback as (...args: unknown[]) => Promise<T>)(...args);\n span.setStatus({ code: 1 });\n return result;\n } catch (error) {\n if (isFinalAttempt) {\n captureException(error, { mechanism: { handled: true, type: 'auto.faas.cloudflare.workflow' } });\n }\n throw error;\n }\n },\n );\n // Deliver after the step span has ended, so the span rides this flush instead of\n // starting an eager drain (same ordering as `wrapMethodWithSentry`'s teardown). The flush runs on the\n // step's scope: the engine calls the step callback outside of `run()`, so the current scope here has\n // neither the client nor the run's trace, and envelopes without a DSC are dropped by Relay.\n return stepResult.then(\n result => {\n this._waitUntil(withScope(scopeForStep, () => flush(2000)));\n return result;\n },\n error => {\n this._waitUntil(withScope(scopeForStep, () => flush(2000)));\n throw error;\n },\n );\n });\n };\n\n if (config) {\n return rollbackOptions\n ? this._step.do(name, config, instrumentedCallback, rollbackOptions)\n : this._step.do(name, config, instrumentedCallback);\n }\n\n return rollbackOptions\n ? this._step.do(name, instrumentedCallback, rollbackOptions)\n : this._step.do(name, instrumentedCallback);\n }\n\n public async sleep(name: string, duration: WorkflowSleepDuration): Promise<void> {\n return this._step.sleep(name, duration);\n }\n\n public async sleepUntil(name: string, timestamp: Date | number): Promise<void> {\n return this._step.sleepUntil(name, timestamp);\n }\n\n public async waitForEvent<T extends Rpc.Serializable<T>>(\n name: string,\n options: { type: string; timeout?: WorkflowTimeoutDuration | number },\n ): Promise<WorkflowStepEvent<T>> {\n return this._step.waitForEvent<T>(name, options);\n }\n}\n\n/**\n * Instruments a Cloudflare Workflow class with Sentry.\n *\n * @example\n * ```typescript\n * const InstrumentedWorkflow = instrumentWorkflowWithSentry(\n * (env) => ({ dsn: env.SENTRY_DSN }),\n * MyWorkflowClass\n * );\n *\n * export default InstrumentedWorkflow;\n * ```\n *\n * @param optionsCallback - Function that returns Sentry options to initialize Sentry\n * @param WorkflowClass - The workflow class to instrument\n * @returns Instrumented workflow class with the same interface\n */\nexport function instrumentWorkflowWithSentry<\n E = DefaultEnv, // Environment type\n P = unknown, // Payload type\n // oxlint-disable-next-line typescript/no-explicit-any\n T extends WorkflowEntrypoint<any, any> = WorkflowEntrypoint<E, P>, // WorkflowEntrypoint type\n // The constraint must not route through `T`: workers-types defaults `WorkflowEntrypoint`'s\n // `Env` to `unknown` (unlike `WorkerEntrypoint`/`DurableObject`, which default to\n // `Cloudflare.Env`), so a bare subclass would be rejected in a `wrangler types` project.\n // The callback env is resolved from the inferred constructor via `ResolveEnv` instead.\n // oxlint-disable-next-line typescript/no-explicit-any\n C extends new (ctx: ExecutionContext, env: any) => WorkflowEntrypoint<any, any> = new (\n ctx: ExecutionContext,\n // oxlint-disable-next-line typescript/no-explicit-any\n env: any,\n ) => T, // Constructor type of the WorkflowEntrypoint class\n O = unknown,\n>(optionsCallback: (env: ResolveEnv<C, E>) => StrictCloudflareOptions<O>, WorkFlowClass: C): C {\n const InstrumentedClass = new Proxy(WorkFlowClass, {\n // oxlint-disable-next-line typescript/no-explicit-any\n construct(target: C, args: [ctx: ExecutionContext, env: any], newTarget) {\n const [ctx, env] = args;\n const context = instrumentContext(ctx);\n const options = optionsCallback(env);\n args[0] = context;\n args[1] = instrumentEnv(env as Record<string, unknown>, options) as E;\n const instance = Reflect.construct(target, args, newTarget) as T;\n return new Proxy(instance, {\n get(obj, prop, receiver) {\n if (prop === 'run') {\n return async function (event: WorkflowEvent<P>, step: WorkflowStep): Promise<unknown> {\n setAsyncLocalStorageAsyncContextStrategy();\n\n return withInvocationIsolationScope(async isolationScope => {\n const waitUntil = getOriginalWaitUntil(context).bind(context);\n const client = init({ ...options, ctx: context, enableDedupe: false });\n isolationScope.setClient(client);\n\n addCloudResourceContext(isolationScope);\n\n return withScope(async scope => {\n const propagationContext = await propagationContextFromInstanceId(event.instanceId);\n scope.setPropagationContext(propagationContext);\n\n try {\n return await obj.run.call(\n obj,\n event,\n new WrappedWorkflowStep(event.instanceId, options, step, waitUntil, isolationScope),\n );\n } finally {\n waitUntil(flushAndDispose(client));\n }\n });\n }, context);\n };\n }\n return Reflect.get(obj, prop, receiver);\n },\n });\n },\n });\n // Recognizable for `_INTERNAL_wrapUnlessInstrumented`, so auto-instrumentation never nests wrappers.\n markAsInstrumented(InstrumentedClass);\n return InstrumentedClass;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAoCA,MAAM,UAAA,GAAa,qEAAA;AAKnB,eAAsB,mCAAmC,UAAA,EAAqC;AAC5F,EAAA,MAAM,GAAA,GAAM,MAAM,MAAA,CAAO,MAAA,CAAO,MAAA,CAAO,OAAA,EAAS,IAAI,WAAA,EAAY,CAAE,MAAA,CAAO,UAAU,CAAC,CAAA;AACpF,EAAA,OACE,KAAA,CAAM,KAAK,IAAI,UAAA,CAAW,GAAG,CAAC,CAAA,CAE3B,KAAA,CAAM,CAAA,EAAG,EAAE,CAAA,CACX,IAAI,CAAA,CAAA,KAAK,CAAA,CAAE,QAAA,CAAS,EAAE,CAAA,CAAE,QAAA,CAAS,GAAG,GAAG,CAAC,CAAA,CACxC,IAAA,CAAK,EAAE,CAAA;AAEd;AAEA,eAAe,iCAAiC,UAAA,EAAiD;AAC/F,EAAA,MAAM,OAAA,GAAU,UAAA,CAAW,IAAA,CAAK,UAAU,CAAA,GACtC,UAAA,CAAW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CAAU,OAAM,KAAA,KAAS;AAC9B,kBAAA,MAAM,kBAAA,GAAqB,MAAM,gCAAA,CAAiC,KAAA,CAAM,UAAU,CAAA;AAClF,kBAAA,KAAA,CAAM,sBAAsB,kBAAkB,CAAA;AAE9C,kBAAA,IAAI;AACF,oBAAA,OAAO,MAAM,IAAI,GAAA,CAAI,IAAA;AAAA,sBACnB,GAAA;AAAA,sBACA,KAAA;AAAA,sBACA,IAAI,mBAAA,CAAoB,KAAA,CAAM,YAAY,OAAA,EAAS,IAAA,EAAM,WAAW,cAAc;AAAA,qBACpF;AAAA,kBACF,CAAA,SAAE;AACA,oBAAA,SAAA,CAAU,eAAA,CAAgB,MAAM,CAAC,CAAA;AAAA,kBACnC;AAAA,gBACF,CAAC,CAAA;AAAA,cACH,GAAG,OAAO,CAAA;AAAA,YACZ,CAAA;AAAA,UACF;AACA,UAAA,OAAO,OAAA,CAAQ,GAAA,CAAI,GAAA,EAAK,IAAA,EAAM,QAAQ,CAAA;AAAA,QACxC;AAAA,OACD,CAAA;AAAA,IACH;AAAA,GACD,CAAA;AAED,EAAA,kBAAA,CAAmB,iBAAiB,CAAA;AACpC,EAAA,OAAO,iBAAA;AACT;;;;"}
@@ -30,11 +30,13 @@ export declare class CloudflareClient extends ServerRuntimeClient {
30
30
  constructor(options: CloudflareClientOptions);
31
31
  /**
32
32
  * Flushes pending operations and ensures all data is processed.
33
- * If a timeout is provided, the operation will be completed within the specified time limit.
34
33
  *
35
- * It will wait for all pending spans to complete before flushing.
34
+ * Each phase waits at most `timeout`: the flush lock of a per-invocation client, pending spans, event
35
+ * processing and the transport drain. So a flush can take a small multiple of `timeout`, which stays well
36
+ * below Cloudflare's 30 second `waitUntil` limit for the timeouts the SDK uses. Sends still pending when
37
+ * the drain times out are aborted.
36
38
  *
37
- * @param {number} [timeout] - Optional timeout in milliseconds to force the completion of the flush operation.
39
+ * @param {number} [timeout] - Maximum time in milliseconds for each phase of the flush.
38
40
  * @return {Promise<boolean>} A promise that resolves to a boolean indicating whether the flush operation was successful.
39
41
  */
40
42
  flush(timeout?: number): Promise<boolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAUpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAG9D;;;;;GAKG;AACH,qBAAa,gBAAiB,SAAQ,mBAAmB;IACvD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA0C;IACrE,OAAO,CAAC,aAAa,CAA0B;IAC/C,OAAO,CAAC,sBAAsB,CAA8B;IAC5D,OAAO,CAAC,sBAAsB,CAA6B;IAE3D,OAAO,CAAC,qBAAqB,CAA6B;IAC1D,OAAO,CAAC,mBAAmB,CAA6B;IAIxD,OAAO,CAAC,gBAAgB,CAAS;IAEjC;;;;OAIG;IACH,SAAgB,cAAc,EAAE,OAAO,CAAC;IAExC;;;OAGG;IACH,YAAmB,OAAO,EAAE,uBAAuB,EA0DlD;IAED;;;;;;;;OAQG;IACU,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAoCrD;IAED;;;;;;;;OAQG;IACa,OAAO,IAAI,IAAI,CAgB9B;IAED,kBAAkB;IAClB,UAAmB,kBAAkB,IAAI,IAAI,CA0B5C;IAED;;OAEG;IACH,OAAO,CAAC,2BAA2B;IAMnC;;;;;;;OAOG;IACH,OAAO,CAAC,2BAA2B;IAanC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,yBAAyB;IAajC;;;OAGG;IACH,OAAO,CAAC,WAAW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AA6B,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAEvD;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,iCAAiC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAE3D;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAE7B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAkB,SAAQ,OAAO,CAAC,0BAA0B,CAAC,EAAE,qBAAqB;IACnG,GAAG,CAAC,EAAE,sBAAsB,CAAC;CAC9B;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAwB,SAAQ,aAAa,CAAC,0BAA0B,CAAC,EAAE,qBAAqB;IAC/G,SAAS,CAAC,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;CAC9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentQueueProducer.d.ts","sourceRoot":"","sources":["../../../../src/instrumentations/worker/instrumentQueueProducer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAsB,KAAK,EAA2C,MAAM,2BAA2B,CAAC;AA2DpH;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC,CAsCzF"}
1
+ {"version":3,"file":"instrumentQueueProducer.d.ts","sourceRoot":"","sources":["../../../../src/instrumentations/worker/instrumentQueueProducer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAsB,KAAK,EAA2C,MAAM,2BAA2B,CAAC;AA2DpH;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC,CAwCzF"}
@@ -15,6 +15,11 @@ export interface CloudflareTransportOptions extends BaseTransportOptions {
15
15
  */
16
16
  export declare class IsolatedPromiseBuffer {
17
17
  $: Array<PromiseLike<TransportMakeRequestResponse>>;
18
+ /**
19
+ * Abort signal of the drain that is starting its requests. It is set only while `drain()` runs the task
20
+ * producers, so a request reads the signal of the drain that sends it.
21
+ */
22
+ drainSignal: AbortSignal | undefined;
18
23
  private _taskProducers;
19
24
  private readonly _bufferSize;
20
25
  constructor(_bufferSize?: number);
@@ -1 +1 @@
1
- {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,4BAA4B,EAAoB,MAAM,cAAc,CAAC;AAGpH,MAAM,WAAW,0BAA2B,SAAQ,oBAAoB;IACtE,iFAAiF;IACjF,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,iCAAiC;IACjC,YAAY,CAAC,EAAE,WAAW,CAAC;CAC5B;AAUD;;;;;;;GAOG;AACH,qBAAa,qBAAqB;IAGzB,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,4BAA4B,CAAC,CAAC,CAAC;IAE3D,OAAO,CAAC,cAAc,CAAsD;IAE5E,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IAErC,YAAmB,WAAW,SAAgC,EAI7D;IAED;;OAEG;IACI,GAAG,CAAC,YAAY,EAAE,MAAM,WAAW,CAAC,4BAA4B,CAAC,GAAG,WAAW,CAAC,4BAA4B,CAAC,CAOnH;IAED;;OAEG;IACI,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAyBnD;CACF;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,0BAA0B,GAAG,SAAS,CAkCtF"}
1
+ {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,4BAA4B,EAAoB,MAAM,cAAc,CAAC;AAGpH,MAAM,WAAW,0BAA2B,SAAQ,oBAAoB;IACtE,iFAAiF;IACjF,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,iCAAiC;IACjC,YAAY,CAAC,EAAE,WAAW,CAAC;CAC5B;AAUD;;;;;;;GAOG;AACH,qBAAa,qBAAqB;IAGzB,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,4BAA4B,CAAC,CAAC,CAAC;IAE3D;;;OAGG;IACI,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;IAE5C,OAAO,CAAC,cAAc,CAAsD;IAE5E,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IAErC,YAAmB,WAAW,SAAgC,EAI7D;IAED;;OAEG;IACI,GAAG,CAAC,YAAY,EAAE,MAAM,WAAW,CAAC,4BAA4B,CAAC,GAAG,WAAW,CAAC,4BAA4B,CAAC,CAOnH;IAED;;OAEG;IACI,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAqCnD;CACF;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,0BAA0B,GAAG,SAAS,CA0CtF"}
@@ -1,6 +1,4 @@
1
- import MagicString from 'magic-string';
2
- /** Whether `id` is the Sentry Flue integration module the provider injects into. */
3
- export declare function isFlueIntegrationModuleId(id: string): boolean;
1
+ import type { ProvidedModulePlugin } from './providedModulePlugin';
4
2
  /**
5
3
  * Splices a static `import * as … from '@flue/runtime'` into Sentry's own Flue integration module
6
4
  * and exposes the namespace on the global orchestrion marker.
@@ -10,14 +8,5 @@ export declare function isFlueIntegrationModuleId(id: string): boolean;
10
8
  * user passes it by calling `instrument()` themselves; a bundled worker has no `node_modules` to
11
9
  * resolve from, so it is supplied at build time instead.
12
10
  */
13
- export declare function sentryFlueRuntimeProviderPlugin(): {
14
- name: string;
15
- configResolved(config: {
16
- root: string;
17
- }): void;
18
- transform(code: string, id: string): {
19
- code: string;
20
- map: ReturnType<MagicString['generateMap']>;
21
- } | undefined;
22
- };
11
+ export declare function sentryFlueRuntimeProviderPlugin(): ProvidedModulePlugin;
23
12
  //# sourceMappingURL=flueRuntime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"flueRuntime.d.ts","sourceRoot":"","sources":["../../../src/vite/flueRuntime.ts"],"names":[],"mappings":"AAEA,OAAO,WAAW,MAAM,cAAc,CAAC;AAavC,oFAAoF;AACpF,wBAAgB,yBAAyB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAG7D;AAED;;;;;;;;GAQG;AACH,wBAAgB,+BAA+B,IAAI;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC/C,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAA;KAAE,GAAG,SAAS,CAAC;CAChH,CAwCA"}
1
+ {"version":3,"file":"flueRuntime.d.ts","sourceRoot":"","sources":["../../../src/vite/flueRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGnE;;;;;;;;GAQG;AACH,wBAAgB,+BAA+B,IAAI,oBAAoB,CAOtE"}
@@ -1,27 +1,12 @@
1
- import MagicString from 'magic-string';
2
- /** Whether `id` is the Sentry Mastra integration module the provider injects into. */
3
- export declare function isMastraIntegrationModuleId(id: string): boolean;
1
+ import type { ProvidedModulePlugin } from './providedModulePlugin';
4
2
  /**
5
- * Splices a static `import * as … from '@mastra/observability'` into Sentry's own
6
- * Mastra integration module and stashes the namespace on the global orchestrion
7
- * marker.
3
+ * Splices a static `import * as … from '@mastra/observability'` into Sentry's own Mastra
4
+ * integration module and stashes the namespace on the global orchestrion marker.
8
5
  *
9
- * On Cloudflare the integration cannot `createRequire('@mastra/observability')` to
10
- * bootstrap Mastra's observability pipeline — there is no on-disk `node_modules` in
11
- * workerd — so without this the user has to construct and wire up an `Observability`
12
- * themselves. The import is static (statically analyzable, no lazy `import()`), lands
13
- * in Sentry's module rather than the user's code, and is only emitted when the package
14
- * actually resolves; if it is absent, the integration keeps its Node `createRequire`
15
- * fallback and the marker stays empty.
6
+ * On Cloudflare the integration cannot `createRequire('@mastra/observability')` to bootstrap
7
+ * Mastra's observability pipeline — there is no on-disk `node_modules` in workerd — so without
8
+ * this the user has to construct and wire up an `Observability` themselves. If the package is
9
+ * absent, the integration keeps its Node `createRequire` fallback and the marker stays empty.
16
10
  */
17
- export declare function sentryMastraObservabilityProviderPlugin(): {
18
- name: string;
19
- configResolved(config: {
20
- root: string;
21
- }): void;
22
- transform(code: string, id: string): {
23
- code: string;
24
- map: ReturnType<MagicString['generateMap']>;
25
- } | undefined;
26
- };
11
+ export declare function sentryMastraObservabilityProviderPlugin(): ProvidedModulePlugin;
27
12
  //# sourceMappingURL=mastraObservability.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mastraObservability.d.ts","sourceRoot":"","sources":["../../../src/vite/mastraObservability.ts"],"names":[],"mappings":"AAEA,OAAO,WAAW,MAAM,cAAc,CAAC;AAYvC,sFAAsF;AACtF,wBAAgB,2BAA2B,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAG/D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,uCAAuC,IAAI;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC/C,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAA;KAAE,GAAG,SAAS,CAAC;CAChH,CA4BA"}
1
+ {"version":3,"file":"mastraObservability.d.ts","sourceRoot":"","sources":["../../../src/vite/mastraObservability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGnE;;;;;;;;GAQG;AACH,wBAAgB,uCAAuC,IAAI,oBAAoB,CAO9E"}
@@ -0,0 +1,62 @@
1
+ import MagicString from 'magic-string';
2
+ /**
3
+ * The slice of the Rollup plugin context the probe needs. Declared here rather than imported so
4
+ * this file carries no Rollup or Vite type dependency.
5
+ */
6
+ interface ResolveContext {
7
+ resolve(source: string, importer?: string, options?: {
8
+ skipSelf?: boolean;
9
+ }): Promise<{
10
+ id: string;
11
+ external?: boolean | string;
12
+ } | null>;
13
+ warn(message: string): void;
14
+ }
15
+ /** The plugin shape `sentryCloudflareVitePlugin` composes. */
16
+ export interface ProvidedModulePlugin {
17
+ name: string;
18
+ applyToEnvironment(environment: {
19
+ config: {
20
+ consumer: string;
21
+ };
22
+ }): boolean;
23
+ configResolved(config: {
24
+ root: string;
25
+ }): void;
26
+ buildStart(this: ResolveContext): Promise<void>;
27
+ transform(code: string, id: string): {
28
+ code: string;
29
+ map: ReturnType<MagicString['generateMap']>;
30
+ } | undefined;
31
+ }
32
+ export interface ProvidedModulePluginOptions {
33
+ /** Vite plugin name, e.g. `sentry-cloudflare-flue-runtime-provider`. */
34
+ name: string;
35
+ /** Bare specifier of the package to provide, e.g. `@flue/runtime`. */
36
+ moduleName: string;
37
+ /** Namespace binding the injected import uses, e.g. `__SENTRY_FLUE_RUNTIME__`. */
38
+ identifier: string;
39
+ /** Basename of the `@sentry/server-utils` integration module to inject into, e.g. `flue`. */
40
+ integrationModule: string;
41
+ }
42
+ /**
43
+ * Build the matcher for one `@sentry/server-utils` integration module.
44
+ *
45
+ * Plain `endsWith`, not a `RegExp`: nothing here needs pattern matching, and building one from
46
+ * a caller-supplied string would need escaping, which is the only reason this file would have to
47
+ * import from `@sentry/core`. A build-time plugin should not drag the SDK into the build.
48
+ */
49
+ export declare function createIntegrationModuleMatcher(integrationModule: string): (id: string) => boolean;
50
+ /**
51
+ * Build a Vite plugin that splices a static `import * as … from '<moduleName>'` into one of
52
+ * Sentry's own integration modules and exposes the namespace on the global orchestrion marker.
53
+ *
54
+ * Some packages are instrumented by registration rather than by patching, so instrumenting them
55
+ * needs a reference to that module's own binding and no channel payload carries one. On Node the
56
+ * integration resolves it itself; a bundled worker has no `node_modules` to resolve from, so the
57
+ * binding is supplied at build time instead. The import is static, lands in Sentry's module rather
58
+ * than the user's code, and is only emitted when the package actually resolves.
59
+ */
60
+ export declare function createProvidedModulePlugin(options: ProvidedModulePluginOptions): ProvidedModulePlugin;
61
+ export {};
62
+ //# sourceMappingURL=providedModulePlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providedModulePlugin.d.ts","sourceRoot":"","sources":["../../../src/vite/providedModulePlugin.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,cAAc,CAAC;AAEvC;;;GAGG;AACH,UAAU,cAAc;IACtB,OAAO,CACL,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAC/B,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC;IAC/D,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,8DAA8D;AAC9D,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,CAAC,WAAW,EAAE;QAAE,MAAM,EAAE;YAAE,QAAQ,EAAE,MAAM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B,GAAG,EAAE,GAAG,KACL,CAAC,EAAE,mDAAmD;AAC3D,CAAC,GAAG,OAAO,EACX,eAAe,EAAE,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,uBAAuB,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,GAAG,CAAC,CAgD7F"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/cloudflare",
3
- "version": "11.0.0-rc.1",
3
+ "version": "11.0.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",
@@ -54,9 +54,9 @@
54
54
  "dependencies": {
55
55
  "@opentelemetry/api": "^1.9.1",
56
56
  "@sentry/conventions": "^0.23.0",
57
- "@sentry/core": "11.0.0-rc.1",
58
- "@sentry/opentelemetry": "11.0.0-rc.1",
59
- "@sentry/server-utils": "11.0.0-rc.1",
57
+ "@sentry/core": "11.0.0",
58
+ "@sentry/opentelemetry": "11.0.0",
59
+ "@sentry/server-utils": "11.0.0",
60
60
  "magic-string": "~0.30.21"
61
61
  },
62
62
  "peerDependencies": {