@sentry/cloudflare 11.0.0-alpha.1 → 11.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/dev/baseSdk.js +20 -8
- package/build/cjs/dev/baseSdk.js.map +1 -1
- package/build/cjs/dev/client.js +118 -25
- package/build/cjs/dev/client.js.map +1 -1
- package/build/cjs/dev/clientCache.js +15 -0
- package/build/cjs/dev/clientCache.js.map +1 -0
- package/build/cjs/dev/defineCloudflareOptions.js.map +1 -1
- package/build/cjs/dev/durableobject.js +4 -62
- package/build/cjs/dev/durableobject.js.map +1 -1
- package/build/cjs/dev/flush.js +6 -4
- package/build/cjs/dev/flush.js.map +1 -1
- package/build/cjs/dev/index.js +8 -7
- package/build/cjs/dev/index.js.map +1 -1
- package/build/cjs/dev/instrumentations/agents/instrumentAgentCallableRpc.js +3 -1
- package/build/cjs/dev/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -1
- package/build/cjs/dev/instrumentations/instrumentDurableObjectHandlers.js +123 -0
- package/build/cjs/dev/instrumentations/instrumentDurableObjectHandlers.js.map +1 -0
- package/build/cjs/dev/instrumentations/instrumentDurableObjectNamespace.js +4 -4
- package/build/cjs/dev/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
- package/build/cjs/dev/instrumentations/instrumentDurableObjectStorage.js +3 -1
- package/build/cjs/dev/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
- package/build/cjs/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js +3 -1
- package/build/cjs/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -1
- package/build/cjs/dev/instrumentations/instrumentSqlStorage.js +6 -3
- package/build/cjs/dev/instrumentations/instrumentSqlStorage.js.map +1 -1
- package/build/cjs/dev/instrumentations/instrumentWorkerEntrypoint.js +9 -16
- package/build/cjs/dev/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentD1.js +10 -3
- package/build/cjs/dev/instrumentations/worker/instrumentD1.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentEmail.js +4 -2
- package/build/cjs/dev/instrumentations/worker/instrumentEmail.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentEnv.js +5 -12
- package/build/cjs/dev/instrumentations/worker/instrumentEnv.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentFetch.js +8 -8
- package/build/cjs/dev/instrumentations/worker/instrumentFetch.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentQueue.js +4 -2
- package/build/cjs/dev/instrumentations/worker/instrumentQueue.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentQueueProducer.js +3 -2
- package/build/cjs/dev/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentR2.js +21 -18
- package/build/cjs/dev/instrumentations/worker/instrumentR2.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentScheduled.js +4 -2
- package/build/cjs/dev/instrumentations/worker/instrumentScheduled.js.map +1 -1
- package/build/cjs/dev/instrumentations/worker/instrumentTail.js +2 -0
- package/build/cjs/dev/instrumentations/worker/instrumentTail.js.map +1 -1
- package/build/cjs/dev/integrations/fetch.js +1 -11
- package/build/cjs/dev/integrations/fetch.js.map +1 -1
- package/build/cjs/dev/opentelemetry/tracer.js +2 -40
- package/build/cjs/dev/opentelemetry/tracer.js.map +1 -1
- package/build/cjs/dev/pages-plugin.js +2 -2
- package/build/cjs/dev/pages-plugin.js.map +1 -1
- package/build/cjs/dev/request.js +2 -123
- package/build/cjs/dev/request.js.map +1 -1
- package/build/cjs/dev/sdk.js +11 -6
- package/build/cjs/dev/sdk.js.map +1 -1
- package/build/cjs/dev/transport.js +1 -1
- package/build/cjs/dev/transport.js.map +1 -1
- package/build/cjs/dev/utils/invocationContext.js +41 -0
- package/build/cjs/dev/utils/invocationContext.js.map +1 -0
- package/build/cjs/dev/utils/invocationScope.js +7 -2
- package/build/cjs/dev/utils/invocationScope.js.map +1 -1
- package/build/cjs/dev/utils/isBinding.js +0 -4
- package/build/cjs/dev/utils/isBinding.js.map +1 -1
- package/build/cjs/dev/utils/rpcPropagation.js +15 -0
- package/build/cjs/dev/utils/rpcPropagation.js.map +1 -0
- package/build/cjs/dev/vendor/stacktrace.js +2 -1
- package/build/cjs/dev/vendor/stacktrace.js.map +1 -1
- package/build/cjs/dev/vite/autoInstrument.js +2 -1
- package/build/cjs/dev/vite/autoInstrument.js.map +1 -1
- package/build/cjs/dev/vite/index.js.map +1 -1
- package/build/cjs/dev/vite/transform.js +30 -5
- package/build/cjs/dev/vite/transform.js.map +1 -1
- package/build/cjs/dev/vite/wranglerConfig.js +21 -1
- package/build/cjs/dev/vite/wranglerConfig.js.map +1 -1
- package/build/cjs/dev/withSentry.js.map +1 -1
- package/build/cjs/dev/workflows.js +45 -33
- package/build/cjs/dev/workflows.js.map +1 -1
- package/build/cjs/dev/wrapMethodWithSentry.js +51 -15
- package/build/cjs/dev/wrapMethodWithSentry.js.map +1 -1
- package/build/cjs/dev/wrapRequestHandlerWithInit.js +134 -0
- package/build/cjs/dev/wrapRequestHandlerWithInit.js.map +1 -0
- package/build/cjs/prod/baseSdk.js +20 -8
- package/build/cjs/prod/baseSdk.js.map +1 -1
- package/build/cjs/prod/client.js +118 -25
- package/build/cjs/prod/client.js.map +1 -1
- package/build/cjs/prod/clientCache.js +15 -0
- package/build/cjs/prod/clientCache.js.map +1 -0
- package/build/cjs/prod/defineCloudflareOptions.js.map +1 -1
- package/build/cjs/prod/durableobject.js +4 -62
- package/build/cjs/prod/durableobject.js.map +1 -1
- package/build/cjs/prod/flush.js +6 -4
- package/build/cjs/prod/flush.js.map +1 -1
- package/build/cjs/prod/index.js +8 -7
- package/build/cjs/prod/index.js.map +1 -1
- package/build/cjs/prod/instrumentations/agents/instrumentAgentCallableRpc.js +3 -1
- package/build/cjs/prod/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -1
- package/build/cjs/prod/instrumentations/instrumentDurableObjectHandlers.js +123 -0
- package/build/cjs/prod/instrumentations/instrumentDurableObjectHandlers.js.map +1 -0
- package/build/cjs/prod/instrumentations/instrumentDurableObjectNamespace.js +4 -4
- package/build/cjs/prod/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
- package/build/cjs/prod/instrumentations/instrumentDurableObjectStorage.js +3 -1
- package/build/cjs/prod/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
- package/build/cjs/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js +3 -1
- package/build/cjs/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -1
- package/build/cjs/prod/instrumentations/instrumentSqlStorage.js +6 -3
- package/build/cjs/prod/instrumentations/instrumentSqlStorage.js.map +1 -1
- package/build/cjs/prod/instrumentations/instrumentWorkerEntrypoint.js +9 -16
- package/build/cjs/prod/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentD1.js +10 -3
- package/build/cjs/prod/instrumentations/worker/instrumentD1.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentEmail.js +4 -2
- package/build/cjs/prod/instrumentations/worker/instrumentEmail.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentEnv.js +5 -12
- package/build/cjs/prod/instrumentations/worker/instrumentEnv.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentFetch.js +8 -8
- package/build/cjs/prod/instrumentations/worker/instrumentFetch.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentQueue.js +4 -2
- package/build/cjs/prod/instrumentations/worker/instrumentQueue.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentQueueProducer.js +3 -2
- package/build/cjs/prod/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentR2.js +21 -18
- package/build/cjs/prod/instrumentations/worker/instrumentR2.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentScheduled.js +4 -2
- package/build/cjs/prod/instrumentations/worker/instrumentScheduled.js.map +1 -1
- package/build/cjs/prod/instrumentations/worker/instrumentTail.js +2 -0
- package/build/cjs/prod/instrumentations/worker/instrumentTail.js.map +1 -1
- package/build/cjs/prod/integrations/fetch.js +1 -11
- package/build/cjs/prod/integrations/fetch.js.map +1 -1
- package/build/cjs/prod/opentelemetry/tracer.js +2 -40
- package/build/cjs/prod/opentelemetry/tracer.js.map +1 -1
- package/build/cjs/prod/pages-plugin.js +2 -2
- package/build/cjs/prod/pages-plugin.js.map +1 -1
- package/build/cjs/prod/request.js +2 -123
- package/build/cjs/prod/request.js.map +1 -1
- package/build/cjs/prod/sdk.js +11 -6
- package/build/cjs/prod/sdk.js.map +1 -1
- package/build/cjs/prod/transport.js +1 -1
- package/build/cjs/prod/transport.js.map +1 -1
- package/build/cjs/prod/utils/invocationContext.js +41 -0
- package/build/cjs/prod/utils/invocationContext.js.map +1 -0
- package/build/cjs/prod/utils/invocationScope.js +7 -2
- package/build/cjs/prod/utils/invocationScope.js.map +1 -1
- package/build/cjs/prod/utils/isBinding.js +0 -4
- package/build/cjs/prod/utils/isBinding.js.map +1 -1
- package/build/cjs/prod/utils/rpcPropagation.js +15 -0
- package/build/cjs/prod/utils/rpcPropagation.js.map +1 -0
- package/build/cjs/prod/vendor/stacktrace.js +2 -1
- package/build/cjs/prod/vendor/stacktrace.js.map +1 -1
- package/build/cjs/prod/vite/autoInstrument.js +2 -1
- package/build/cjs/prod/vite/autoInstrument.js.map +1 -1
- package/build/cjs/prod/vite/index.js.map +1 -1
- package/build/cjs/prod/vite/transform.js +30 -5
- package/build/cjs/prod/vite/transform.js.map +1 -1
- package/build/cjs/prod/vite/wranglerConfig.js +21 -1
- package/build/cjs/prod/vite/wranglerConfig.js.map +1 -1
- package/build/cjs/prod/withSentry.js.map +1 -1
- package/build/cjs/prod/workflows.js +45 -33
- package/build/cjs/prod/workflows.js.map +1 -1
- package/build/cjs/prod/wrapMethodWithSentry.js +51 -15
- package/build/cjs/prod/wrapMethodWithSentry.js.map +1 -1
- package/build/cjs/prod/wrapRequestHandlerWithInit.js +134 -0
- package/build/cjs/prod/wrapRequestHandlerWithInit.js.map +1 -0
- package/build/esm/dev/baseSdk.js +21 -9
- package/build/esm/dev/baseSdk.js.map +1 -1
- package/build/esm/dev/client.js +118 -25
- package/build/esm/dev/client.js.map +1 -1
- package/build/esm/dev/clientCache.js +12 -0
- package/build/esm/dev/clientCache.js.map +1 -0
- package/build/esm/dev/defineCloudflareOptions.js.map +1 -1
- package/build/esm/dev/durableobject.js +5 -63
- package/build/esm/dev/durableobject.js.map +1 -1
- package/build/esm/dev/flush.js +6 -4
- package/build/esm/dev/flush.js.map +1 -1
- package/build/esm/dev/index.js +4 -4
- package/build/esm/dev/instrumentations/agents/instrumentAgentCallableRpc.js +4 -2
- package/build/esm/dev/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -1
- package/build/esm/dev/instrumentations/instrumentDurableObjectHandlers.js +121 -0
- package/build/esm/dev/instrumentations/instrumentDurableObjectHandlers.js.map +1 -0
- package/build/esm/dev/instrumentations/instrumentDurableObjectNamespace.js +4 -4
- package/build/esm/dev/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
- package/build/esm/dev/instrumentations/instrumentDurableObjectStorage.js +3 -1
- package/build/esm/dev/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
- package/build/esm/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js +3 -1
- package/build/esm/dev/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -1
- package/build/esm/dev/instrumentations/instrumentSqlStorage.js +5 -2
- package/build/esm/dev/instrumentations/instrumentSqlStorage.js.map +1 -1
- package/build/esm/dev/instrumentations/instrumentWorkerEntrypoint.js +9 -16
- package/build/esm/dev/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentD1.js +11 -4
- package/build/esm/dev/instrumentations/worker/instrumentD1.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentEmail.js +7 -5
- package/build/esm/dev/instrumentations/worker/instrumentEmail.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentEnv.js +6 -13
- package/build/esm/dev/instrumentations/worker/instrumentEnv.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentFetch.js +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentFetch.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentQueue.js +7 -5
- package/build/esm/dev/instrumentations/worker/instrumentQueue.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentQueueProducer.js +4 -3
- package/build/esm/dev/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentR2.js +22 -19
- package/build/esm/dev/instrumentations/worker/instrumentR2.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentScheduled.js +7 -5
- package/build/esm/dev/instrumentations/worker/instrumentScheduled.js.map +1 -1
- package/build/esm/dev/instrumentations/worker/instrumentTail.js +2 -0
- package/build/esm/dev/instrumentations/worker/instrumentTail.js.map +1 -1
- package/build/esm/dev/integrations/fetch.js +2 -12
- package/build/esm/dev/integrations/fetch.js.map +1 -1
- package/build/esm/dev/opentelemetry/tracer.js +2 -40
- package/build/esm/dev/opentelemetry/tracer.js.map +1 -1
- package/build/esm/dev/package.json +1 -1
- package/build/esm/dev/pages-plugin.js +1 -1
- package/build/esm/dev/pages-plugin.js.map +1 -1
- package/build/esm/dev/request.js +2 -122
- package/build/esm/dev/request.js.map +1 -1
- package/build/esm/dev/sdk.js +11 -7
- package/build/esm/dev/sdk.js.map +1 -1
- package/build/esm/dev/transport.js +1 -1
- package/build/esm/dev/transport.js.map +1 -1
- package/build/esm/dev/utils/invocationContext.js +37 -0
- package/build/esm/dev/utils/invocationContext.js.map +1 -0
- package/build/esm/dev/utils/invocationScope.js +7 -2
- package/build/esm/dev/utils/invocationScope.js.map +1 -1
- package/build/esm/dev/utils/isBinding.js +1 -4
- package/build/esm/dev/utils/isBinding.js.map +1 -1
- package/build/esm/dev/utils/rpcPropagation.js +13 -0
- package/build/esm/dev/utils/rpcPropagation.js.map +1 -0
- package/build/esm/dev/utils/traceLinks.js +1 -1
- package/build/esm/dev/vendor/stacktrace.js +2 -1
- package/build/esm/dev/vendor/stacktrace.js.map +1 -1
- package/build/esm/dev/vite/autoInstrument.js +2 -1
- package/build/esm/dev/vite/autoInstrument.js.map +1 -1
- package/build/esm/dev/vite/index.js.map +1 -1
- package/build/esm/dev/vite/transform.js +30 -5
- package/build/esm/dev/vite/transform.js.map +1 -1
- package/build/esm/dev/vite/wranglerConfig.js +21 -2
- package/build/esm/dev/vite/wranglerConfig.js.map +1 -1
- package/build/esm/dev/withSentry.js.map +1 -1
- package/build/esm/dev/workflows.js +48 -36
- package/build/esm/dev/workflows.js.map +1 -1
- package/build/esm/dev/wrapMethodWithSentry.js +53 -17
- package/build/esm/dev/wrapMethodWithSentry.js.map +1 -1
- package/build/esm/dev/wrapRequestHandlerWithInit.js +132 -0
- package/build/esm/dev/wrapRequestHandlerWithInit.js.map +1 -0
- package/build/esm/prod/baseSdk.js +21 -9
- package/build/esm/prod/baseSdk.js.map +1 -1
- package/build/esm/prod/client.js +118 -25
- package/build/esm/prod/client.js.map +1 -1
- package/build/esm/prod/clientCache.js +12 -0
- package/build/esm/prod/clientCache.js.map +1 -0
- package/build/esm/prod/defineCloudflareOptions.js.map +1 -1
- package/build/esm/prod/durableobject.js +5 -63
- package/build/esm/prod/durableobject.js.map +1 -1
- package/build/esm/prod/flush.js +6 -4
- package/build/esm/prod/flush.js.map +1 -1
- package/build/esm/prod/index.js +4 -4
- package/build/esm/prod/instrumentations/agents/instrumentAgentCallableRpc.js +4 -2
- package/build/esm/prod/instrumentations/agents/instrumentAgentCallableRpc.js.map +1 -1
- package/build/esm/prod/instrumentations/instrumentDurableObjectHandlers.js +121 -0
- package/build/esm/prod/instrumentations/instrumentDurableObjectHandlers.js.map +1 -0
- package/build/esm/prod/instrumentations/instrumentDurableObjectNamespace.js +4 -4
- package/build/esm/prod/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
- package/build/esm/prod/instrumentations/instrumentDurableObjectStorage.js +3 -1
- package/build/esm/prod/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
- package/build/esm/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js +3 -1
- package/build/esm/prod/instrumentations/instrumentDurableObjectSyncKvStorage.js.map +1 -1
- package/build/esm/prod/instrumentations/instrumentSqlStorage.js +5 -2
- package/build/esm/prod/instrumentations/instrumentSqlStorage.js.map +1 -1
- package/build/esm/prod/instrumentations/instrumentWorkerEntrypoint.js +9 -16
- package/build/esm/prod/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentD1.js +11 -4
- package/build/esm/prod/instrumentations/worker/instrumentD1.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentEmail.js +7 -5
- package/build/esm/prod/instrumentations/worker/instrumentEmail.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentEnv.js +6 -13
- package/build/esm/prod/instrumentations/worker/instrumentEnv.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentFetch.js +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentFetch.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentQueue.js +7 -5
- package/build/esm/prod/instrumentations/worker/instrumentQueue.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentQueueProducer.js +4 -3
- package/build/esm/prod/instrumentations/worker/instrumentQueueProducer.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentR2.js +22 -19
- package/build/esm/prod/instrumentations/worker/instrumentR2.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentScheduled.js +7 -5
- package/build/esm/prod/instrumentations/worker/instrumentScheduled.js.map +1 -1
- package/build/esm/prod/instrumentations/worker/instrumentTail.js +2 -0
- package/build/esm/prod/instrumentations/worker/instrumentTail.js.map +1 -1
- package/build/esm/prod/integrations/fetch.js +2 -12
- package/build/esm/prod/integrations/fetch.js.map +1 -1
- package/build/esm/prod/opentelemetry/tracer.js +2 -40
- package/build/esm/prod/opentelemetry/tracer.js.map +1 -1
- package/build/esm/prod/package.json +1 -1
- package/build/esm/prod/pages-plugin.js +1 -1
- package/build/esm/prod/pages-plugin.js.map +1 -1
- package/build/esm/prod/request.js +2 -122
- package/build/esm/prod/request.js.map +1 -1
- package/build/esm/prod/sdk.js +11 -7
- package/build/esm/prod/sdk.js.map +1 -1
- package/build/esm/prod/transport.js +1 -1
- package/build/esm/prod/transport.js.map +1 -1
- package/build/esm/prod/utils/invocationContext.js +37 -0
- package/build/esm/prod/utils/invocationContext.js.map +1 -0
- package/build/esm/prod/utils/invocationScope.js +7 -2
- package/build/esm/prod/utils/invocationScope.js.map +1 -1
- package/build/esm/prod/utils/isBinding.js +1 -4
- package/build/esm/prod/utils/isBinding.js.map +1 -1
- package/build/esm/prod/utils/rpcPropagation.js +13 -0
- package/build/esm/prod/utils/rpcPropagation.js.map +1 -0
- package/build/esm/prod/utils/traceLinks.js +1 -1
- package/build/esm/prod/vendor/stacktrace.js +2 -1
- package/build/esm/prod/vendor/stacktrace.js.map +1 -1
- package/build/esm/prod/vite/autoInstrument.js +2 -1
- package/build/esm/prod/vite/autoInstrument.js.map +1 -1
- package/build/esm/prod/vite/index.js.map +1 -1
- package/build/esm/prod/vite/transform.js +30 -5
- package/build/esm/prod/vite/transform.js.map +1 -1
- package/build/esm/prod/vite/wranglerConfig.js +21 -2
- package/build/esm/prod/vite/wranglerConfig.js.map +1 -1
- package/build/esm/prod/withSentry.js.map +1 -1
- package/build/esm/prod/workflows.js +48 -36
- package/build/esm/prod/workflows.js.map +1 -1
- package/build/esm/prod/wrapMethodWithSentry.js +53 -17
- package/build/esm/prod/wrapMethodWithSentry.js.map +1 -1
- package/build/esm/prod/wrapRequestHandlerWithInit.js +132 -0
- package/build/esm/prod/wrapRequestHandlerWithInit.js.map +1 -0
- package/build/types/baseSdk.d.ts +8 -0
- package/build/types/baseSdk.d.ts.map +1 -1
- package/build/types/client.d.ts +91 -18
- package/build/types/client.d.ts.map +1 -1
- package/build/types/clientCache.d.ts +8 -0
- package/build/types/clientCache.d.ts.map +1 -0
- package/build/types/defineCloudflareOptions.d.ts +3 -2
- package/build/types/defineCloudflareOptions.d.ts.map +1 -1
- package/build/types/durableobject.d.ts +5 -7
- package/build/types/durableobject.d.ts.map +1 -1
- package/build/types/flush.d.ts +2 -0
- package/build/types/flush.d.ts.map +1 -1
- package/build/types/index.d.ts +4 -4
- package/build/types/index.d.ts.map +1 -1
- package/build/types/instrumentations/agents/instrumentAgentCallableRpc.d.ts.map +1 -1
- package/build/types/instrumentations/instrumentDurableObjectHandlers.d.ts +28 -0
- package/build/types/instrumentations/instrumentDurableObjectHandlers.d.ts.map +1 -0
- package/build/types/instrumentations/instrumentDurableObjectNamespace.d.ts +2 -1
- package/build/types/instrumentations/instrumentDurableObjectNamespace.d.ts.map +1 -1
- package/build/types/instrumentations/instrumentDurableObjectStorage.d.ts.map +1 -1
- package/build/types/instrumentations/instrumentDurableObjectSyncKvStorage.d.ts.map +1 -1
- package/build/types/instrumentations/instrumentSqlStorage.d.ts.map +1 -1
- package/build/types/instrumentations/instrumentWorkerEntrypoint.d.ts +2 -3
- package/build/types/instrumentations/instrumentWorkerEntrypoint.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentD1.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentEmail.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentEnv.d.ts +0 -1
- package/build/types/instrumentations/worker/instrumentEnv.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentQueue.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentQueueProducer.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentR2.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentScheduled.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentTail.d.ts.map +1 -1
- package/build/types/integrations/fetch.d.ts.map +1 -1
- package/build/types/opentelemetry/tracer.d.ts.map +1 -1
- package/build/types/pages-plugin.d.ts +3 -1
- package/build/types/pages-plugin.d.ts.map +1 -1
- package/build/types/request.d.ts +5 -31
- package/build/types/request.d.ts.map +1 -1
- package/build/types/sdk.d.ts +13 -4
- package/build/types/sdk.d.ts.map +1 -1
- package/build/types/transport.d.ts.map +1 -1
- package/build/types/types.d.ts +28 -0
- package/build/types/types.d.ts.map +1 -1
- package/build/types/utils/invocationContext.d.ts +58 -0
- package/build/types/utils/invocationContext.d.ts.map +1 -0
- package/build/types/utils/invocationScope.d.ts +2 -1
- package/build/types/utils/invocationScope.d.ts.map +1 -1
- package/build/types/utils/isBinding.d.ts +1 -9
- package/build/types/utils/isBinding.d.ts.map +1 -1
- package/build/types/utils/rpcPropagation.d.ts +10 -0
- package/build/types/utils/rpcPropagation.d.ts.map +1 -0
- package/build/types/vendor/stacktrace.d.ts.map +1 -1
- package/build/types/vite/autoInstrument.d.ts.map +1 -1
- package/build/types/vite/index.d.ts +4 -0
- package/build/types/vite/index.d.ts.map +1 -1
- package/build/types/vite/transform.d.ts +3 -0
- package/build/types/vite/transform.d.ts.map +1 -1
- package/build/types/vite/wranglerConfig.d.ts +13 -0
- package/build/types/vite/wranglerConfig.d.ts.map +1 -1
- package/build/types/withSentry.d.ts +2 -3
- package/build/types/withSentry.d.ts.map +1 -1
- package/build/types/workflows.d.ts +3 -3
- package/build/types/workflows.d.ts.map +1 -1
- package/build/types/wrapMethodWithSentry.d.ts +6 -1
- package/build/types/wrapMethodWithSentry.d.ts.map +1 -1
- package/build/types/wrapRequestHandlerWithInit.d.ts +31 -0
- package/build/types/wrapRequestHandlerWithInit.d.ts.map +1 -0
- package/package.json +6 -4
- package/build/cjs/dev/instrumentations/worker/instrumentRateLimit.js +0 -29
- package/build/cjs/dev/instrumentations/worker/instrumentRateLimit.js.map +0 -1
- package/build/cjs/dev/integrations/tracing/vercelai.js +0 -18
- package/build/cjs/dev/integrations/tracing/vercelai.js.map +0 -1
- package/build/cjs/prod/instrumentations/worker/instrumentRateLimit.js +0 -29
- package/build/cjs/prod/instrumentations/worker/instrumentRateLimit.js.map +0 -1
- package/build/cjs/prod/integrations/tracing/vercelai.js +0 -18
- package/build/cjs/prod/integrations/tracing/vercelai.js.map +0 -1
- package/build/esm/dev/instrumentations/worker/instrumentRateLimit.js +0 -27
- package/build/esm/dev/instrumentations/worker/instrumentRateLimit.js.map +0 -1
- package/build/esm/dev/integrations/tracing/vercelai.js +0 -16
- package/build/esm/dev/integrations/tracing/vercelai.js.map +0 -1
- package/build/esm/prod/instrumentations/worker/instrumentRateLimit.js +0 -27
- package/build/esm/prod/instrumentations/worker/instrumentRateLimit.js.map +0 -1
- package/build/esm/prod/integrations/tracing/vercelai.js +0 -16
- package/build/esm/prod/integrations/tracing/vercelai.js.map +0 -1
- package/build/types/instrumentations/worker/instrumentRateLimit.d.ts +0 -6
- package/build/types/instrumentations/worker/instrumentRateLimit.d.ts.map +0 -1
- package/build/types/integrations/tracing/vercelai.d.ts +0 -39
- package/build/types/integrations/tracing/vercelai.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autoInstrument.d.ts","sourceRoot":"","sources":["../../../src/vite/autoInstrument.ts"],"names":[],"mappings":"AACA,OAAO,EAA8C,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAgB/F,wBAAgB,oCAAoC,CAAC,OAAO,GAAE;IAAE,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAAO;IAQ9F,IAAI;IAEJ,cAAc,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE;YAAE,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAA;KAAE,GAAG,IAAI;IAiC9E,SAAS,OACP,cAAc,GAAG;QAAE,IAAI,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,WAAW,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,QAC9E,MAAM,MACR,MAAM,GACT,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"autoInstrument.d.ts","sourceRoot":"","sources":["../../../src/vite/autoInstrument.ts"],"names":[],"mappings":"AACA,OAAO,EAA8C,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAgB/F,wBAAgB,oCAAoC,CAAC,OAAO,GAAE;IAAE,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAAO;IAQ9F,IAAI;IAEJ,cAAc,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE;YAAE,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAA;KAAE,GAAG,IAAI;IAiC9E,SAAS,OACP,cAAc,GAAG;QAAE,IAAI,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,WAAW,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,QAC9E,MAAM,MACR,MAAM,GACT,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC;EAkFzD"}
|
|
@@ -37,6 +37,10 @@ export interface SentryCloudflareVitePluginOptions {
|
|
|
37
37
|
* left alone, so this is safe alongside manual instrumentation. Set to
|
|
38
38
|
* `false` to opt out.
|
|
39
39
|
*
|
|
40
|
+
* The plugin also adds the bindings that resolve to the wrapped classes (this worker's own
|
|
41
|
+
* Durable Objects and self service bindings) to `rpcTracePropagationBindings`. Bindings to
|
|
42
|
+
* other workers stay opt-in, their receivers may not run Sentry.
|
|
43
|
+
*
|
|
40
44
|
* @default true
|
|
41
45
|
*/
|
|
42
46
|
autoInstrumentation?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vite/index.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD;;;;;;;;;OASG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;;;;;;;OAYG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vite/index.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD;;;;;;;;;OASG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;;;;;;;OAYG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;;;;;;;;;;;;;;OAeG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,iCAAsC,GAAG,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CASnH"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import MagicString from 'magic-string';
|
|
2
|
+
import { type SameWorkerBinding } from './wranglerConfig';
|
|
2
3
|
export interface BaseNode {
|
|
3
4
|
type: string;
|
|
4
5
|
start: number;
|
|
@@ -34,6 +35,8 @@ export interface TransformContext {
|
|
|
34
35
|
optionsFn: string;
|
|
35
36
|
/** Import statement prepended when `optionsFn` references a separate module. */
|
|
36
37
|
optionsImport?: string;
|
|
38
|
+
/** @see {@link import('./wranglerConfig').WranglerConfig.sameWorkerBindings} */
|
|
39
|
+
sameWorkerBindings?: readonly SameWorkerBinding[];
|
|
37
40
|
}
|
|
38
41
|
export interface TransformResult {
|
|
39
42
|
code: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/vite/transform.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/vite/transform.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,EAAmC,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAS3F,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,EAAE,CAAC;CAClB;AAuDD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAAG,OAAO,GAAG,UAAU,GAAG,kBAAkB,CAAC;AAc3F,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC7C;;;OAGG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gFAAgF;IAChF,kBAAkB,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACnD;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC;IAC5C;;;;OAIG;IACH,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,WAAW,EAChB,GAAG,EAAE,gBAAgB,GACpB,eAAe,GAAG,SAAS,CAsD7B"}
|
|
@@ -20,6 +20,19 @@ export interface WranglerConfig {
|
|
|
20
20
|
* an export on a *different* worker, which this build can't wrap.
|
|
21
21
|
*/
|
|
22
22
|
workerEntrypoints: string[];
|
|
23
|
+
/**
|
|
24
|
+
* Bindings whose RPC receiver lives in this worker, so this build instruments it. Not deduped by
|
|
25
|
+
* class, two bindings may point at the same class and both names have to be listed.
|
|
26
|
+
*/
|
|
27
|
+
sameWorkerBindings: SameWorkerBinding[];
|
|
28
|
+
}
|
|
29
|
+
/** Stands in for a class name where a binding targets the module's default export. */
|
|
30
|
+
export declare const DEFAULT_EXPORT: unique symbol;
|
|
31
|
+
/** The name a binding or an export is known by, either an exported class name or the default export. */
|
|
32
|
+
export type ExportName = string | typeof DEFAULT_EXPORT;
|
|
33
|
+
export interface SameWorkerBinding {
|
|
34
|
+
bindingName: string;
|
|
35
|
+
className: ExportName;
|
|
23
36
|
}
|
|
24
37
|
/**
|
|
25
38
|
* Locate and resolve the wrangler configuration via wrangler's own
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wranglerConfig.d.ts","sourceRoot":"","sources":["../../../src/vite/wranglerConfig.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC3D,SAAS,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtD;;;;;OAKG;IACH,iBAAiB,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"wranglerConfig.d.ts","sourceRoot":"","sources":["../../../src/vite/wranglerConfig.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC3D,SAAS,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtD;;;;;OAKG;IACH,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B;;;OAGG;IACH,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;CACzC;AAED,sFAAsF;AACtF,eAAO,MAAM,cAAc,eAA0B,CAAC;AAEtD,wGAAwG;AACxG,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,cAAc,CAAC;AAExD,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,UAAU,CAAC;CACvB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,YAAY,CAAC,EAAE,MAAM,GACpB;IAAE,MAAM,EAAE,cAAc,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CA4B3D"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { AnyExportedHandler, DefaultEnv, ResolveEnv } from './types';
|
|
1
|
+
import type { AnyExportedHandler, DefaultEnv, ResolveEnv, StrictCloudflareOptions } from './types';
|
|
3
2
|
import { type WorkerEntrypointConstructor } from './instrumentations/instrumentWorkerEntrypoint';
|
|
4
3
|
/**
|
|
5
4
|
* Wrapper for Cloudflare handlers.
|
|
@@ -12,5 +11,5 @@ import { type WorkerEntrypointConstructor } from './instrumentations/instrumentW
|
|
|
12
11
|
* @param handler {ExportedHandler} The handler to wrap.
|
|
13
12
|
* @returns The wrapped handler.
|
|
14
13
|
*/
|
|
15
|
-
export declare function withSentry<Env = DefaultEnv, QueueHandlerMessage = unknown, CfHostMetadata = unknown, T extends AnyExportedHandler | WorkerEntrypointConstructor<any, any> = ExportedHandler<Env, QueueHandlerMessage, CfHostMetadata> | WorkerEntrypointConstructor<Env
|
|
14
|
+
export declare function withSentry<Env = DefaultEnv, QueueHandlerMessage = unknown, CfHostMetadata = unknown, T extends AnyExportedHandler | WorkerEntrypointConstructor<any, any> = ExportedHandler<Env, QueueHandlerMessage, CfHostMetadata> | WorkerEntrypointConstructor<Env>, O = unknown>(optionsCallback: (env: ResolveEnv<T, Env>) => StrictCloudflareOptions<O> | undefined, handler: T): T;
|
|
16
15
|
//# sourceMappingURL=withSentry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withSentry.d.ts","sourceRoot":"","sources":["../../src/withSentry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"withSentry.d.ts","sourceRoot":"","sources":["../../src/withSentry.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AACnG,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,+CAA+C,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CACxB,GAAG,GAAG,UAAU,EAChB,mBAAmB,GAAG,OAAO,EAC7B,cAAc,GAAG,OAAO,EAExB,CAAC,SAAS,kBAAkB,GAAG,2BAA2B,CAAC,GAAG,EAAE,GAAG,CAAC,GAChE,eAAe,CAAC,GAAG,EAAE,mBAAmB,EAAE,cAAc,CAAC,GACzD,2BAA2B,CAAC,GAAG,CAAC,EACpC,CAAC,GAAG,OAAO,EACX,eAAe,EAAE,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,uBAAuB,CAAC,CAAC,CAAC,GAAG,SAAS,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAyBrG"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { WorkflowEntrypoint } from 'cloudflare:workers';
|
|
2
|
-
import type {
|
|
3
|
-
import type { DefaultEnv, ResolveEnv } from './types';
|
|
2
|
+
import type { DefaultEnv, ResolveEnv, StrictCloudflareOptions } from './types';
|
|
4
3
|
/**
|
|
5
4
|
* Hashes a string to a UUID using SHA-1.
|
|
6
5
|
*/
|
|
@@ -25,5 +24,6 @@ export declare function deterministicTraceIdFromInstanceId(instanceId: string):
|
|
|
25
24
|
export declare function instrumentWorkflowWithSentry<E = DefaultEnv, // Environment type
|
|
26
25
|
P = unknown, // Payload type
|
|
27
26
|
T extends WorkflowEntrypoint<any, any> = WorkflowEntrypoint<E, P>, // WorkflowEntrypoint type
|
|
28
|
-
C extends new (ctx: ExecutionContext, env: any) => WorkflowEntrypoint<any, any> = new (ctx: ExecutionContext, env: any) => T
|
|
27
|
+
C extends new (ctx: ExecutionContext, env: any) => WorkflowEntrypoint<any, any> = new (ctx: ExecutionContext, env: any) => T, // Constructor type of the WorkflowEntrypoint class
|
|
28
|
+
O = unknown>(optionsCallback: (env: ResolveEnv<C, E>) => StrictCloudflareOptions<O>, WorkFlowClass: C): C;
|
|
29
29
|
//# sourceMappingURL=workflows.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/workflows.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/workflows.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAEV,kBAAkB,EASnB,MAAM,oBAAoB,CAAC;AAQ5B,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAK/E;;GAEG;AACH,wBAAsB,kCAAkC,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAS5F;AAuJD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,4BAA4B,CAC1C,CAAC,GAAG,UAAU,EAAE,mBAAmB;AACnC,CAAC,GAAG,OAAO,EAAE,eAAe;AAE5B,CAAC,SAAS,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,0BAA0B;AAM7F,CAAC,SAAS,KAAK,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,GAAG,KAAK,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,KAChF,GAAG,EAAE,gBAAgB,EAErB,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,CA6C7F"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import type { DurableObjectStorage } from '@cloudflare/workers-types';
|
|
2
|
+
import type { SerializedTraceData } from '@sentry/core';
|
|
2
3
|
import type { CloudflareOptions } from './client';
|
|
3
4
|
/** Extended DurableObjectState with originalStorage exposed by instrumentContext */
|
|
4
5
|
export interface InstrumentedDurableObjectState extends DurableObjectState {
|
|
5
6
|
originalStorage?: DurableObjectStorage;
|
|
6
7
|
}
|
|
7
8
|
type MethodWrapperOptions = {
|
|
8
|
-
|
|
9
|
+
/**
|
|
10
|
+
* The span name, or a resolver called with the RPC metadata of the current call.
|
|
11
|
+
* Returning `undefined` skips the span and only captures errors.
|
|
12
|
+
*/
|
|
13
|
+
spanName?: string | ((rpcMeta: SerializedTraceData | undefined) => string | undefined);
|
|
9
14
|
spanOp?: string;
|
|
10
15
|
options: CloudflareOptions;
|
|
11
16
|
context: ExecutionContext | InstrumentedDurableObjectState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapMethodWithSentry.d.ts","sourceRoot":"","sources":["../../src/wrapMethodWithSentry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"wrapMethodWithSentry.d.ts","sourceRoot":"","sources":["../../src/wrapMethodWithSentry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAYxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAUlD,oFAAoF;AACpF,MAAM,WAAW,8BAA+B,SAAQ,kBAAkB;IACxE,eAAe,CAAC,EAAE,oBAAoB,CAAC;CACxC;AAyBD,KAAK,oBAAoB,GAAG;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,mBAAmB,GAAG,SAAS,KAAK,MAAM,GAAG,SAAS,CAAC,CAAC;IACvF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,gBAAgB,GAAG,8BAA8B,CAAC;IAC3D;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAGF,MAAM,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AACtD,KAAK,cAAc,GAAG,eAAe,CAAC;AAEtC;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,cAAc,EAC3D,cAAc,EAAE,oBAAoB,EACpC,OAAO,EAAE,CAAC,EACV,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,EAC3C,MAAM,CAAC,EAAE,IAAI,GACZ,CAAC,CAsMH"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CfProperties, IncomingRequestCfProperties } from '@cloudflare/workers-types';
|
|
2
|
+
import type { CloudflareClient, CloudflareOptions } from './client';
|
|
3
|
+
import type { ExecutionContextCompat } from './executionContext';
|
|
4
|
+
export interface RequestHandlerWrapperOptions {
|
|
5
|
+
options: CloudflareOptions;
|
|
6
|
+
request: Request<unknown, IncomingRequestCfProperties<unknown> | CfProperties<unknown>>;
|
|
7
|
+
context: ExecutionContextCompat | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* If true, errors will be captured, rethrown and sent to Sentry.
|
|
10
|
+
* Otherwise, errors are rethrown but not captured.
|
|
11
|
+
*
|
|
12
|
+
* You most likely don't want to set this to `false`, if you use `wrapRequestHandler` directly.
|
|
13
|
+
* This is primarily meant as an escape hatch for higher-level SDKs relying on additional error
|
|
14
|
+
* capturing mechanisms where this wrapper captures errors too early or too generally.
|
|
15
|
+
*
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
captureErrors?: boolean;
|
|
19
|
+
}
|
|
20
|
+
type InitSdk = (options: CloudflareOptions) => CloudflareClient | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Same as {@link wrapRequestHandler}, but with the SDK initialization injected.
|
|
23
|
+
*
|
|
24
|
+
* Wrappers that are only reachable from the main entry point — where `nodejs_compat` is a
|
|
25
|
+
* requirement anyway — pass `init` from `sdk.ts` to get the full default integrations.
|
|
26
|
+
*
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare function wrapRequestHandlerWithInit(wrapperOptions: RequestHandlerWrapperOptions, handler: (...args: unknown[]) => Response | Promise<Response>, initSdk: InitSdk): Promise<Response>;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=wrapRequestHandlerWithInit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrapRequestHandlerWithInit.d.ts","sourceRoot":"","sources":["../../src/wrapRequestHandlerWithInit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAqB3F,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAYjE,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,2BAA2B,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;IACxF,OAAO,EAAE,sBAAsB,GAAG,SAAS,CAAC;IAC5C;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,KAAK,OAAO,GAAG,CAAC,OAAO,EAAE,iBAAiB,KAAK,gBAAgB,GAAG,SAAS,CAAC;AAE5E;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,4BAA4B,EAC5C,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,EAC7D,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,QAAQ,CAAC,CAuKnB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/cloudflare",
|
|
3
|
-
"version": "11.0.0-
|
|
3
|
+
"version": "11.0.0-beta.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",
|
|
@@ -48,9 +48,10 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@opentelemetry/api": "^1.9.1",
|
|
51
|
-
"@sentry/conventions": "^0.
|
|
52
|
-
"@sentry/core": "11.0.0-
|
|
53
|
-
"@sentry/
|
|
51
|
+
"@sentry/conventions": "^0.20.0",
|
|
52
|
+
"@sentry/core": "11.0.0-beta.0",
|
|
53
|
+
"@sentry/opentelemetry": "11.0.0-beta.0",
|
|
54
|
+
"@sentry/server-utils": "11.0.0-beta.0",
|
|
54
55
|
"magic-string": "~0.30.21"
|
|
55
56
|
},
|
|
56
57
|
"peerDependencies": {
|
|
@@ -83,6 +84,7 @@
|
|
|
83
84
|
"clean": "rimraf build coverage sentry-cloudflare-*.tgz",
|
|
84
85
|
"lint:fix": "oxlint . --fix --type-aware",
|
|
85
86
|
"lint": "oxlint . --type-aware",
|
|
87
|
+
"lint:types": "oxlint src --type-aware --type-check",
|
|
86
88
|
"lint:es-compatibility": "es-check es2022 ./build/cjs/prod/*.js && es-check es2022 ./build/esm/prod/*.js --module",
|
|
87
89
|
"test": "yarn test:unit",
|
|
88
90
|
"test:unit": "vitest run",
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
3
|
-
const core = require('@sentry/core');
|
|
4
|
-
|
|
5
|
-
const ORIGIN = "auto.faas.cloudflare.rate_limit";
|
|
6
|
-
function instrumentRateLimit(rateLimit, bindingName) {
|
|
7
|
-
return new Proxy(rateLimit, {
|
|
8
|
-
get(target, prop, receiver) {
|
|
9
|
-
if (prop !== "limit") {
|
|
10
|
-
return Reflect.get(target, prop, receiver);
|
|
11
|
-
}
|
|
12
|
-
const original = Reflect.get(target, prop, receiver);
|
|
13
|
-
return function(options) {
|
|
14
|
-
return core.startSpan(
|
|
15
|
-
{
|
|
16
|
-
name: `rate_limit ${bindingName}`,
|
|
17
|
-
attributes: {
|
|
18
|
-
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
() => Reflect.apply(original, target, [options])
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
exports.instrumentRateLimit = instrumentRateLimit;
|
|
29
|
-
//# sourceMappingURL=instrumentRateLimit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentRateLimit.js","sources":["../../../../../src/instrumentations/worker/instrumentRateLimit.ts"],"sourcesContent":["import type { RateLimit, RateLimitOptions, RateLimitOutcome } from '@cloudflare/workers-types';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startSpan } from '@sentry/core';\n\nconst ORIGIN = 'auto.faas.cloudflare.rate_limit';\n\n/**\n * Wraps a Cloudflare rate limiter binding to create a span on each `limit()` call.\n */\nexport function instrumentRateLimit<T extends RateLimit>(rateLimit: T, bindingName: string): T {\n return new Proxy(rateLimit, {\n get(target, prop, receiver) {\n if (prop !== 'limit') {\n return Reflect.get(target, prop, receiver);\n }\n\n const original = Reflect.get(target, prop, receiver) as RateLimit['limit'];\n\n return function (this: unknown, options: RateLimitOptions): Promise<RateLimitOutcome> {\n return startSpan(\n {\n name: `rate_limit ${bindingName}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n },\n },\n () => Reflect.apply(original, target, [options]),\n );\n };\n },\n });\n}\n"],"names":["startSpan","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN"],"mappings":";;;;AAGA,MAAM,MAAA,GAAS,iCAAA;AAKR,SAAS,mBAAA,CAAyC,WAAc,WAAA,EAAwB;AAC7F,EAAA,OAAO,IAAI,MAAM,SAAA,EAAW;AAAA,IAC1B,GAAA,CAAI,MAAA,EAAQ,IAAA,EAAM,QAAA,EAAU;AAC1B,MAAA,IAAI,SAAS,OAAA,EAAS;AACpB,QAAA,OAAO,OAAA,CAAQ,GAAA,CAAI,MAAA,EAAQ,IAAA,EAAM,QAAQ,CAAA;AAAA,MAC3C;AAEA,MAAA,MAAM,QAAA,GAAW,OAAA,CAAQ,GAAA,CAAI,MAAA,EAAQ,MAAM,QAAQ,CAAA;AAEnD,MAAA,OAAO,SAAyB,OAAA,EAAsD;AACpF,QAAA,OAAOA,cAAA;AAAA,UACL;AAAA,YACE,IAAA,EAAM,cAAc,WAAW,CAAA,CAAA;AAAA,YAC/B,UAAA,EAAY;AAAA,cACV,CAACC,qCAAgC,GAAG;AAAA;AACtC,WACF;AAAA,UACA,MAAM,OAAA,CAAQ,KAAA,CAAM,UAAU,MAAA,EAAQ,CAAC,OAAO,CAAC;AAAA,SACjD;AAAA,MACF,CAAA;AAAA,IACF;AAAA,GACD,CAAA;AACH;;;;"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
3
|
-
const core = require('@sentry/core');
|
|
4
|
-
const serverUtils = require('@sentry/server-utils');
|
|
5
|
-
|
|
6
|
-
const _vercelAIIntegration = ((options = {}) => {
|
|
7
|
-
const inner = serverUtils.vercelAiIntegration(options);
|
|
8
|
-
return core.extendIntegration(inner, {
|
|
9
|
-
options,
|
|
10
|
-
setup(client) {
|
|
11
|
-
serverUtils.addVercelAiProcessors(client);
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
});
|
|
15
|
-
const vercelAIIntegration = core.defineIntegration(_vercelAIIntegration);
|
|
16
|
-
|
|
17
|
-
exports.vercelAIIntegration = vercelAIIntegration;
|
|
18
|
-
//# sourceMappingURL=vercelai.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vercelai.js","sources":["../../../../../src/integrations/tracing/vercelai.ts"],"sourcesContent":["/**\n * This is a copy of the Vercel AI integration from the node SDK.\n *\n * The only difference is that it does not use `@opentelemetry/instrumentation`\n * because Cloudflare Workers do not support it.\n *\n * Therefore, we cannot automatically patch setting `experimental_telemetry: { isEnabled: true }`\n * and users have to manually set this to get spans.\n */\n\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, extendIntegration } from '@sentry/core';\nimport { addVercelAiProcessors, vercelAiIntegration, type VercelAiOptions } from '@sentry/server-utils';\n\nconst _vercelAIIntegration = ((options: VercelAiOptions = {}) => {\n const inner = vercelAiIntegration(options);\n\n return extendIntegration(inner, {\n options,\n setup(client) {\n addVercelAiProcessors(client);\n },\n });\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.\n * This integration is not enabled by default, you need to manually add it.\n *\n * For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).\n *\n * You need to enable collecting spans for a specific call by setting\n * `experimental_telemetry.isEnabled` to `true` in the first argument of the function call.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true },\n * });\n * ```\n *\n * If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each\n * function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs`\n * to `true`.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },\n * });\n */\nexport const vercelAIIntegration = defineIntegration(_vercelAIIntegration);\n"],"names":["vercelAiIntegration","extendIntegration","addVercelAiProcessors","defineIntegration"],"mappings":";;;;;AAcA,MAAM,oBAAA,IAAwB,CAAC,OAAA,GAA2B,EAAC,KAAM;AAC/D,EAAA,MAAM,KAAA,GAAQA,gCAAoB,OAAO,CAAA;AAEzC,EAAA,OAAOC,uBAAkB,KAAA,EAAO;AAAA,IAC9B,OAAA;AAAA,IACA,MAAM,MAAA,EAAQ;AACZ,MAAAC,iCAAA,CAAsB,MAAM,CAAA;AAAA,IAC9B;AAAA,GACD,CAAA;AACH,CAAA,CAAA;AA4BO,MAAM,mBAAA,GAAsBC,uBAAkB,oBAAoB;;;;"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
3
|
-
const core = require('@sentry/core');
|
|
4
|
-
|
|
5
|
-
const ORIGIN = "auto.faas.cloudflare.rate_limit";
|
|
6
|
-
function instrumentRateLimit(rateLimit, bindingName) {
|
|
7
|
-
return new Proxy(rateLimit, {
|
|
8
|
-
get(target, prop, receiver) {
|
|
9
|
-
if (prop !== "limit") {
|
|
10
|
-
return Reflect.get(target, prop, receiver);
|
|
11
|
-
}
|
|
12
|
-
const original = Reflect.get(target, prop, receiver);
|
|
13
|
-
return function(options) {
|
|
14
|
-
return core.startSpan(
|
|
15
|
-
{
|
|
16
|
-
name: `rate_limit ${bindingName}`,
|
|
17
|
-
attributes: {
|
|
18
|
-
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
() => Reflect.apply(original, target, [options])
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
exports.instrumentRateLimit = instrumentRateLimit;
|
|
29
|
-
//# sourceMappingURL=instrumentRateLimit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentRateLimit.js","sources":["../../../../../src/instrumentations/worker/instrumentRateLimit.ts"],"sourcesContent":["import type { RateLimit, RateLimitOptions, RateLimitOutcome } from '@cloudflare/workers-types';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startSpan } from '@sentry/core';\n\nconst ORIGIN = 'auto.faas.cloudflare.rate_limit';\n\n/**\n * Wraps a Cloudflare rate limiter binding to create a span on each `limit()` call.\n */\nexport function instrumentRateLimit<T extends RateLimit>(rateLimit: T, bindingName: string): T {\n return new Proxy(rateLimit, {\n get(target, prop, receiver) {\n if (prop !== 'limit') {\n return Reflect.get(target, prop, receiver);\n }\n\n const original = Reflect.get(target, prop, receiver) as RateLimit['limit'];\n\n return function (this: unknown, options: RateLimitOptions): Promise<RateLimitOutcome> {\n return startSpan(\n {\n name: `rate_limit ${bindingName}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n },\n },\n () => Reflect.apply(original, target, [options]),\n );\n };\n },\n });\n}\n"],"names":["startSpan","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN"],"mappings":";;;;AAGA,MAAM,MAAA,GAAS,iCAAA;AAKR,SAAS,mBAAA,CAAyC,WAAc,WAAA,EAAwB;AAC7F,EAAA,OAAO,IAAI,MAAM,SAAA,EAAW;AAAA,IAC1B,GAAA,CAAI,MAAA,EAAQ,IAAA,EAAM,QAAA,EAAU;AAC1B,MAAA,IAAI,SAAS,OAAA,EAAS;AACpB,QAAA,OAAO,OAAA,CAAQ,GAAA,CAAI,MAAA,EAAQ,IAAA,EAAM,QAAQ,CAAA;AAAA,MAC3C;AAEA,MAAA,MAAM,QAAA,GAAW,OAAA,CAAQ,GAAA,CAAI,MAAA,EAAQ,MAAM,QAAQ,CAAA;AAEnD,MAAA,OAAO,SAAyB,OAAA,EAAsD;AACpF,QAAA,OAAOA,cAAA;AAAA,UACL;AAAA,YACE,IAAA,EAAM,cAAc,WAAW,CAAA,CAAA;AAAA,YAC/B,UAAA,EAAY;AAAA,cACV,CAACC,qCAAgC,GAAG;AAAA;AACtC,WACF;AAAA,UACA,MAAM,OAAA,CAAQ,KAAA,CAAM,UAAU,MAAA,EAAQ,CAAC,OAAO,CAAC;AAAA,SACjD;AAAA,MACF,CAAA;AAAA,IACF;AAAA,GACD,CAAA;AACH;;;;"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
3
|
-
const core = require('@sentry/core');
|
|
4
|
-
const serverUtils = require('@sentry/server-utils');
|
|
5
|
-
|
|
6
|
-
const _vercelAIIntegration = ((options = {}) => {
|
|
7
|
-
const inner = serverUtils.vercelAiIntegration(options);
|
|
8
|
-
return core.extendIntegration(inner, {
|
|
9
|
-
options,
|
|
10
|
-
setup(client) {
|
|
11
|
-
serverUtils.addVercelAiProcessors(client);
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
});
|
|
15
|
-
const vercelAIIntegration = core.defineIntegration(_vercelAIIntegration);
|
|
16
|
-
|
|
17
|
-
exports.vercelAIIntegration = vercelAIIntegration;
|
|
18
|
-
//# sourceMappingURL=vercelai.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vercelai.js","sources":["../../../../../src/integrations/tracing/vercelai.ts"],"sourcesContent":["/**\n * This is a copy of the Vercel AI integration from the node SDK.\n *\n * The only difference is that it does not use `@opentelemetry/instrumentation`\n * because Cloudflare Workers do not support it.\n *\n * Therefore, we cannot automatically patch setting `experimental_telemetry: { isEnabled: true }`\n * and users have to manually set this to get spans.\n */\n\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, extendIntegration } from '@sentry/core';\nimport { addVercelAiProcessors, vercelAiIntegration, type VercelAiOptions } from '@sentry/server-utils';\n\nconst _vercelAIIntegration = ((options: VercelAiOptions = {}) => {\n const inner = vercelAiIntegration(options);\n\n return extendIntegration(inner, {\n options,\n setup(client) {\n addVercelAiProcessors(client);\n },\n });\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.\n * This integration is not enabled by default, you need to manually add it.\n *\n * For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).\n *\n * You need to enable collecting spans for a specific call by setting\n * `experimental_telemetry.isEnabled` to `true` in the first argument of the function call.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true },\n * });\n * ```\n *\n * If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each\n * function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs`\n * to `true`.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },\n * });\n */\nexport const vercelAIIntegration = defineIntegration(_vercelAIIntegration);\n"],"names":["vercelAiIntegration","extendIntegration","addVercelAiProcessors","defineIntegration"],"mappings":";;;;;AAcA,MAAM,oBAAA,IAAwB,CAAC,OAAA,GAA2B,EAAC,KAAM;AAC/D,EAAA,MAAM,KAAA,GAAQA,gCAAoB,OAAO,CAAA;AAEzC,EAAA,OAAOC,uBAAkB,KAAA,EAAO;AAAA,IAC9B,OAAA;AAAA,IACA,MAAM,MAAA,EAAQ;AACZ,MAAAC,iCAAA,CAAsB,MAAM,CAAA;AAAA,IAC9B;AAAA,GACD,CAAA;AACH,CAAA,CAAA;AA4BO,MAAM,mBAAA,GAAsBC,uBAAkB,oBAAoB;;;;"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { startSpan, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
|
|
2
|
-
|
|
3
|
-
const ORIGIN = "auto.faas.cloudflare.rate_limit";
|
|
4
|
-
function instrumentRateLimit(rateLimit, bindingName) {
|
|
5
|
-
return new Proxy(rateLimit, {
|
|
6
|
-
get(target, prop, receiver) {
|
|
7
|
-
if (prop !== "limit") {
|
|
8
|
-
return Reflect.get(target, prop, receiver);
|
|
9
|
-
}
|
|
10
|
-
const original = Reflect.get(target, prop, receiver);
|
|
11
|
-
return function(options) {
|
|
12
|
-
return startSpan(
|
|
13
|
-
{
|
|
14
|
-
name: `rate_limit ${bindingName}`,
|
|
15
|
-
attributes: {
|
|
16
|
-
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
() => Reflect.apply(original, target, [options])
|
|
20
|
-
);
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { instrumentRateLimit };
|
|
27
|
-
//# sourceMappingURL=instrumentRateLimit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentRateLimit.js","sources":["../../../../../src/instrumentations/worker/instrumentRateLimit.ts"],"sourcesContent":["import type { RateLimit, RateLimitOptions, RateLimitOutcome } from '@cloudflare/workers-types';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startSpan } from '@sentry/core';\n\nconst ORIGIN = 'auto.faas.cloudflare.rate_limit';\n\n/**\n * Wraps a Cloudflare rate limiter binding to create a span on each `limit()` call.\n */\nexport function instrumentRateLimit<T extends RateLimit>(rateLimit: T, bindingName: string): T {\n return new Proxy(rateLimit, {\n get(target, prop, receiver) {\n if (prop !== 'limit') {\n return Reflect.get(target, prop, receiver);\n }\n\n const original = Reflect.get(target, prop, receiver) as RateLimit['limit'];\n\n return function (this: unknown, options: RateLimitOptions): Promise<RateLimitOutcome> {\n return startSpan(\n {\n name: `rate_limit ${bindingName}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n },\n },\n () => Reflect.apply(original, target, [options]),\n );\n };\n },\n });\n}\n"],"names":[],"mappings":";;AAGA,MAAM,MAAA,GAAS,iCAAA;AAKR,SAAS,mBAAA,CAAyC,WAAc,WAAA,EAAwB;AAC7F,EAAA,OAAO,IAAI,MAAM,SAAA,EAAW;AAAA,IAC1B,GAAA,CAAI,MAAA,EAAQ,IAAA,EAAM,QAAA,EAAU;AAC1B,MAAA,IAAI,SAAS,OAAA,EAAS;AACpB,QAAA,OAAO,OAAA,CAAQ,GAAA,CAAI,MAAA,EAAQ,IAAA,EAAM,QAAQ,CAAA;AAAA,MAC3C;AAEA,MAAA,MAAM,QAAA,GAAW,OAAA,CAAQ,GAAA,CAAI,MAAA,EAAQ,MAAM,QAAQ,CAAA;AAEnD,MAAA,OAAO,SAAyB,OAAA,EAAsD;AACpF,QAAA,OAAO,SAAA;AAAA,UACL;AAAA,YACE,IAAA,EAAM,cAAc,WAAW,CAAA,CAAA;AAAA,YAC/B,UAAA,EAAY;AAAA,cACV,CAAC,gCAAgC,GAAG;AAAA;AACtC,WACF;AAAA,UACA,MAAM,OAAA,CAAQ,KAAA,CAAM,UAAU,MAAA,EAAQ,CAAC,OAAO,CAAC;AAAA,SACjD;AAAA,MACF,CAAA;AAAA,IACF;AAAA,GACD,CAAA;AACH;;;;"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { defineIntegration, extendIntegration } from '@sentry/core';
|
|
2
|
-
import { vercelAiIntegration, addVercelAiProcessors } from '@sentry/server-utils';
|
|
3
|
-
|
|
4
|
-
const _vercelAIIntegration = ((options = {}) => {
|
|
5
|
-
const inner = vercelAiIntegration(options);
|
|
6
|
-
return extendIntegration(inner, {
|
|
7
|
-
options,
|
|
8
|
-
setup(client) {
|
|
9
|
-
addVercelAiProcessors(client);
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
const vercelAIIntegration = defineIntegration(_vercelAIIntegration);
|
|
14
|
-
|
|
15
|
-
export { vercelAIIntegration };
|
|
16
|
-
//# sourceMappingURL=vercelai.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vercelai.js","sources":["../../../../../src/integrations/tracing/vercelai.ts"],"sourcesContent":["/**\n * This is a copy of the Vercel AI integration from the node SDK.\n *\n * The only difference is that it does not use `@opentelemetry/instrumentation`\n * because Cloudflare Workers do not support it.\n *\n * Therefore, we cannot automatically patch setting `experimental_telemetry: { isEnabled: true }`\n * and users have to manually set this to get spans.\n */\n\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, extendIntegration } from '@sentry/core';\nimport { addVercelAiProcessors, vercelAiIntegration, type VercelAiOptions } from '@sentry/server-utils';\n\nconst _vercelAIIntegration = ((options: VercelAiOptions = {}) => {\n const inner = vercelAiIntegration(options);\n\n return extendIntegration(inner, {\n options,\n setup(client) {\n addVercelAiProcessors(client);\n },\n });\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.\n * This integration is not enabled by default, you need to manually add it.\n *\n * For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).\n *\n * You need to enable collecting spans for a specific call by setting\n * `experimental_telemetry.isEnabled` to `true` in the first argument of the function call.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true },\n * });\n * ```\n *\n * If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each\n * function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs`\n * to `true`.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },\n * });\n */\nexport const vercelAIIntegration = defineIntegration(_vercelAIIntegration);\n"],"names":[],"mappings":";;;AAcA,MAAM,oBAAA,IAAwB,CAAC,OAAA,GAA2B,EAAC,KAAM;AAC/D,EAAA,MAAM,KAAA,GAAQ,oBAAoB,OAAO,CAAA;AAEzC,EAAA,OAAO,kBAAkB,KAAA,EAAO;AAAA,IAC9B,OAAA;AAAA,IACA,MAAM,MAAA,EAAQ;AACZ,MAAA,qBAAA,CAAsB,MAAM,CAAA;AAAA,IAC9B;AAAA,GACD,CAAA;AACH,CAAA,CAAA;AA4BO,MAAM,mBAAA,GAAsB,kBAAkB,oBAAoB;;;;"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { startSpan, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
|
|
2
|
-
|
|
3
|
-
const ORIGIN = "auto.faas.cloudflare.rate_limit";
|
|
4
|
-
function instrumentRateLimit(rateLimit, bindingName) {
|
|
5
|
-
return new Proxy(rateLimit, {
|
|
6
|
-
get(target, prop, receiver) {
|
|
7
|
-
if (prop !== "limit") {
|
|
8
|
-
return Reflect.get(target, prop, receiver);
|
|
9
|
-
}
|
|
10
|
-
const original = Reflect.get(target, prop, receiver);
|
|
11
|
-
return function(options) {
|
|
12
|
-
return startSpan(
|
|
13
|
-
{
|
|
14
|
-
name: `rate_limit ${bindingName}`,
|
|
15
|
-
attributes: {
|
|
16
|
-
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
() => Reflect.apply(original, target, [options])
|
|
20
|
-
);
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { instrumentRateLimit };
|
|
27
|
-
//# sourceMappingURL=instrumentRateLimit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentRateLimit.js","sources":["../../../../../src/instrumentations/worker/instrumentRateLimit.ts"],"sourcesContent":["import type { RateLimit, RateLimitOptions, RateLimitOutcome } from '@cloudflare/workers-types';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startSpan } from '@sentry/core';\n\nconst ORIGIN = 'auto.faas.cloudflare.rate_limit';\n\n/**\n * Wraps a Cloudflare rate limiter binding to create a span on each `limit()` call.\n */\nexport function instrumentRateLimit<T extends RateLimit>(rateLimit: T, bindingName: string): T {\n return new Proxy(rateLimit, {\n get(target, prop, receiver) {\n if (prop !== 'limit') {\n return Reflect.get(target, prop, receiver);\n }\n\n const original = Reflect.get(target, prop, receiver) as RateLimit['limit'];\n\n return function (this: unknown, options: RateLimitOptions): Promise<RateLimitOutcome> {\n return startSpan(\n {\n name: `rate_limit ${bindingName}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n },\n },\n () => Reflect.apply(original, target, [options]),\n );\n };\n },\n });\n}\n"],"names":[],"mappings":";;AAGA,MAAM,MAAA,GAAS,iCAAA;AAKR,SAAS,mBAAA,CAAyC,WAAc,WAAA,EAAwB;AAC7F,EAAA,OAAO,IAAI,MAAM,SAAA,EAAW;AAAA,IAC1B,GAAA,CAAI,MAAA,EAAQ,IAAA,EAAM,QAAA,EAAU;AAC1B,MAAA,IAAI,SAAS,OAAA,EAAS;AACpB,QAAA,OAAO,OAAA,CAAQ,GAAA,CAAI,MAAA,EAAQ,IAAA,EAAM,QAAQ,CAAA;AAAA,MAC3C;AAEA,MAAA,MAAM,QAAA,GAAW,OAAA,CAAQ,GAAA,CAAI,MAAA,EAAQ,MAAM,QAAQ,CAAA;AAEnD,MAAA,OAAO,SAAyB,OAAA,EAAsD;AACpF,QAAA,OAAO,SAAA;AAAA,UACL;AAAA,YACE,IAAA,EAAM,cAAc,WAAW,CAAA,CAAA;AAAA,YAC/B,UAAA,EAAY;AAAA,cACV,CAAC,gCAAgC,GAAG;AAAA;AACtC,WACF;AAAA,UACA,MAAM,OAAA,CAAQ,KAAA,CAAM,UAAU,MAAA,EAAQ,CAAC,OAAO,CAAC;AAAA,SACjD;AAAA,MACF,CAAA;AAAA,IACF;AAAA,GACD,CAAA;AACH;;;;"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { defineIntegration, extendIntegration } from '@sentry/core';
|
|
2
|
-
import { vercelAiIntegration, addVercelAiProcessors } from '@sentry/server-utils';
|
|
3
|
-
|
|
4
|
-
const _vercelAIIntegration = ((options = {}) => {
|
|
5
|
-
const inner = vercelAiIntegration(options);
|
|
6
|
-
return extendIntegration(inner, {
|
|
7
|
-
options,
|
|
8
|
-
setup(client) {
|
|
9
|
-
addVercelAiProcessors(client);
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
const vercelAIIntegration = defineIntegration(_vercelAIIntegration);
|
|
14
|
-
|
|
15
|
-
export { vercelAIIntegration };
|
|
16
|
-
//# sourceMappingURL=vercelai.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vercelai.js","sources":["../../../../../src/integrations/tracing/vercelai.ts"],"sourcesContent":["/**\n * This is a copy of the Vercel AI integration from the node SDK.\n *\n * The only difference is that it does not use `@opentelemetry/instrumentation`\n * because Cloudflare Workers do not support it.\n *\n * Therefore, we cannot automatically patch setting `experimental_telemetry: { isEnabled: true }`\n * and users have to manually set this to get spans.\n */\n\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, extendIntegration } from '@sentry/core';\nimport { addVercelAiProcessors, vercelAiIntegration, type VercelAiOptions } from '@sentry/server-utils';\n\nconst _vercelAIIntegration = ((options: VercelAiOptions = {}) => {\n const inner = vercelAiIntegration(options);\n\n return extendIntegration(inner, {\n options,\n setup(client) {\n addVercelAiProcessors(client);\n },\n });\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.\n * This integration is not enabled by default, you need to manually add it.\n *\n * For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).\n *\n * You need to enable collecting spans for a specific call by setting\n * `experimental_telemetry.isEnabled` to `true` in the first argument of the function call.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true },\n * });\n * ```\n *\n * If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each\n * function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs`\n * to `true`.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },\n * });\n */\nexport const vercelAIIntegration = defineIntegration(_vercelAIIntegration);\n"],"names":[],"mappings":";;;AAcA,MAAM,oBAAA,IAAwB,CAAC,OAAA,GAA2B,EAAC,KAAM;AAC/D,EAAA,MAAM,KAAA,GAAQ,oBAAoB,OAAO,CAAA;AAEzC,EAAA,OAAO,kBAAkB,KAAA,EAAO;AAAA,IAC9B,OAAA;AAAA,IACA,MAAM,MAAA,EAAQ;AACZ,MAAA,qBAAA,CAAsB,MAAM,CAAA;AAAA,IAC9B;AAAA,GACD,CAAA;AACH,CAAA,CAAA;AA4BO,MAAM,mBAAA,GAAsB,kBAAkB,oBAAoB;;;;"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { RateLimit } from '@cloudflare/workers-types';
|
|
2
|
-
/**
|
|
3
|
-
* Wraps a Cloudflare rate limiter binding to create a span on each `limit()` call.
|
|
4
|
-
*/
|
|
5
|
-
export declare function instrumentRateLimit<T extends RateLimit>(rateLimit: T, bindingName: string): T;
|
|
6
|
-
//# sourceMappingURL=instrumentRateLimit.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentRateLimit.d.ts","sourceRoot":"","sources":["../../../../src/instrumentations/worker/instrumentRateLimit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAsC,MAAM,2BAA2B,CAAC;AAK/F;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,SAAS,EAAE,SAAS,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC,CAsB7F"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This is a copy of the Vercel AI integration from the node SDK.
|
|
3
|
-
*
|
|
4
|
-
* The only difference is that it does not use `@opentelemetry/instrumentation`
|
|
5
|
-
* because Cloudflare Workers do not support it.
|
|
6
|
-
*
|
|
7
|
-
* Therefore, we cannot automatically patch setting `experimental_telemetry: { isEnabled: true }`
|
|
8
|
-
* and users have to manually set this to get spans.
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.
|
|
12
|
-
* This integration is not enabled by default, you need to manually add it.
|
|
13
|
-
*
|
|
14
|
-
* For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).
|
|
15
|
-
*
|
|
16
|
-
* You need to enable collecting spans for a specific call by setting
|
|
17
|
-
* `experimental_telemetry.isEnabled` to `true` in the first argument of the function call.
|
|
18
|
-
*
|
|
19
|
-
* ```javascript
|
|
20
|
-
* const result = await generateText({
|
|
21
|
-
* model: openai('gpt-4-turbo'),
|
|
22
|
-
* experimental_telemetry: { isEnabled: true },
|
|
23
|
-
* });
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each
|
|
27
|
-
* function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs`
|
|
28
|
-
* to `true`.
|
|
29
|
-
*
|
|
30
|
-
* ```javascript
|
|
31
|
-
* const result = await generateText({
|
|
32
|
-
* model: openai('gpt-4-turbo'),
|
|
33
|
-
* experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },
|
|
34
|
-
* });
|
|
35
|
-
*/
|
|
36
|
-
export declare const vercelAIIntegration: (options?: import("@sentry/server-utils").GenAiOptions | undefined) => import("@sentry/core").Integration & {
|
|
37
|
-
name: "VercelAI";
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=vercelai.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vercelai.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/vercelai.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAiBH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,mBAAmB;;CAA0C,CAAC"}
|