@sentry/cloudflare 10.59.0 → 10.61.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 (51) hide show
  1. package/build/cjs/async.js +2 -1
  2. package/build/cjs/async.js.map +1 -1
  3. package/build/cjs/index.js +3 -0
  4. package/build/cjs/index.js.map +1 -1
  5. package/build/cjs/instrumentations/instrumentDurableObjectStorage.js +4 -0
  6. package/build/cjs/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
  7. package/build/cjs/instrumentations/instrumentSqlStorage.js +37 -0
  8. package/build/cjs/instrumentations/instrumentSqlStorage.js.map +1 -0
  9. package/build/cjs/instrumentations/worker/instrumentD1.js +58 -4
  10. package/build/cjs/instrumentations/worker/instrumentD1.js.map +1 -1
  11. package/build/cjs/instrumentations/worker/instrumentEnv.js +7 -0
  12. package/build/cjs/instrumentations/worker/instrumentEnv.js.map +1 -1
  13. package/build/cjs/instrumentations/worker/instrumentR2.js +124 -0
  14. package/build/cjs/instrumentations/worker/instrumentR2.js.map +1 -0
  15. package/build/cjs/utils/isBinding.js +4 -0
  16. package/build/cjs/utils/isBinding.js.map +1 -1
  17. package/build/esm/async.js +3 -2
  18. package/build/esm/async.js.map +1 -1
  19. package/build/esm/index.js +1 -1
  20. package/build/esm/instrumentations/instrumentDurableObjectStorage.js +4 -0
  21. package/build/esm/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
  22. package/build/esm/instrumentations/instrumentSqlStorage.js +35 -0
  23. package/build/esm/instrumentations/instrumentSqlStorage.js.map +1 -0
  24. package/build/esm/instrumentations/worker/instrumentD1.js +58 -4
  25. package/build/esm/instrumentations/worker/instrumentD1.js.map +1 -1
  26. package/build/esm/instrumentations/worker/instrumentEnv.js +8 -1
  27. package/build/esm/instrumentations/worker/instrumentEnv.js.map +1 -1
  28. package/build/esm/instrumentations/worker/instrumentR2.js +122 -0
  29. package/build/esm/instrumentations/worker/instrumentR2.js.map +1 -0
  30. package/build/esm/package.json +1 -1
  31. package/build/esm/utils/isBinding.js +4 -1
  32. package/build/esm/utils/isBinding.js.map +1 -1
  33. package/build/types/async.d.ts.map +1 -1
  34. package/build/types/index.d.ts +1 -1
  35. package/build/types/index.d.ts.map +1 -1
  36. package/build/types/instrumentations/instrumentDurableObjectStorage.d.ts.map +1 -1
  37. package/build/types/instrumentations/instrumentSqlStorage.d.ts +9 -0
  38. package/build/types/instrumentations/instrumentSqlStorage.d.ts.map +1 -0
  39. package/build/types/instrumentations/worker/instrumentD1.d.ts.map +1 -1
  40. package/build/types/instrumentations/worker/instrumentEnv.d.ts +1 -2
  41. package/build/types/instrumentations/worker/instrumentEnv.d.ts.map +1 -1
  42. package/build/types/instrumentations/worker/instrumentR2.d.ts +9 -0
  43. package/build/types/instrumentations/worker/instrumentR2.d.ts.map +1 -0
  44. package/build/types/utils/isBinding.d.ts +6 -1
  45. package/build/types/utils/isBinding.d.ts.map +1 -1
  46. package/build/types-ts3.8/index.d.ts +1 -1
  47. package/build/types-ts3.8/instrumentations/instrumentSqlStorage.d.ts +9 -0
  48. package/build/types-ts3.8/instrumentations/worker/instrumentEnv.d.ts +1 -2
  49. package/build/types-ts3.8/instrumentations/worker/instrumentR2.d.ts +9 -0
  50. package/build/types-ts3.8/utils/isBinding.d.ts +6 -1
  51. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  export { Breadcrumb, BreadcrumbHint, PolymorphicRequest, RequestEventData, SdkInfo, Event, EventHint, ErrorEvent, Exception, FeatureFlagsIntegration, Session, SeverityLevel, Span, StackFrame, Stacktrace, Thread, User, Metric, ExclusiveEventHintOrCaptureContext, CaptureContext, } from '@sentry/core';
2
2
  export { CloudflareOptions } from './client';
3
- export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureMessage, captureFeedback, close, createTransport, lastEventId, flush, getClient, isInitialized, isEnabled, getCurrentScope, getGlobalScope, getIsolationScope, setCurrentClient, Scope, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setUser, setConversationId, getSpanStatusFromHttpCode, setHttpStatus, withScope, withIsolationScope, captureCheckIn, withMonitor, setMeasurement, getActiveSpan, getRootSpan, getTraceData, getTraceMetaTags, startSpan, startInactiveSpan, startSpanManual, startNewTrace, suppressTracing, withActiveSpan, getSpanDescendants, continueTrace, functionToStringIntegration, inboundFiltersIntegration, instrumentOpenAiClient, instrumentGoogleGenAIClient, instrumentAnthropicAiClient, eventFiltersIntegration, linkedErrorsIntegration, requestDataIntegration, extraErrorDataIntegration, dedupeIntegration, rewriteFramesIntegration, captureConsoleIntegration, moduleMetadataIntegration, supabaseIntegration, instrumentSupabaseClient, instrumentPostgresJsSql, zodErrorsIntegration, consoleIntegration, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, trpcMiddleware, spanToJSON, spanToTraceHeader, spanToBaggageHeader, updateSpanName, wrapMcpServerWithSentry, consoleLoggingIntegration, createConsolaReporter, createLangChainCallbackHandler, instrumentLangChainEmbeddings, featureFlagsIntegration, growthbookIntegration, logger, metrics, withStreamedSpan, spanStreamingIntegration, instrumentLangGraph, instrumentCreateReactAgent, } from '@sentry/core';
3
+ export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureMessage, captureFeedback, close, createTransport, lastEventId, flush, getClient, isInitialized, isEnabled, getCurrentScope, getGlobalScope, getIsolationScope, setCurrentClient, Scope, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setAttribute, setAttributes, setUser, setConversationId, getSpanStatusFromHttpCode, setHttpStatus, withScope, withIsolationScope, captureCheckIn, withMonitor, setMeasurement, getActiveSpan, getRootSpan, getTraceData, getTraceMetaTags, startSpan, startInactiveSpan, startSpanManual, startNewTrace, bindScopeToEmitter, suppressTracing, withActiveSpan, getSpanDescendants, continueTrace, functionToStringIntegration, inboundFiltersIntegration, instrumentOpenAiClient, instrumentGoogleGenAIClient, instrumentAnthropicAiClient, eventFiltersIntegration, linkedErrorsIntegration, requestDataIntegration, extraErrorDataIntegration, dedupeIntegration, rewriteFramesIntegration, captureConsoleIntegration, moduleMetadataIntegration, supabaseIntegration, instrumentSupabaseClient, instrumentPostgresJsSql, zodErrorsIntegration, consoleIntegration, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, trpcMiddleware, spanToJSON, spanToTraceHeader, spanToBaggageHeader, updateSpanName, wrapMcpServerWithSentry, consoleLoggingIntegration, createConsolaReporter, createLangChainCallbackHandler, instrumentLangChainEmbeddings, featureFlagsIntegration, growthbookIntegration, logger, metrics, withStreamedSpan, spanStreamingIntegration, instrumentLangGraph, instrumentCreateReactAgent, } from '@sentry/core';
4
4
  export { withSentry } from './withSentry';
5
5
  export { instrumentDurableObjectWithSentry } from './durableobject';
6
6
  export { sentryPagesPlugin } from './pages-plugin';
@@ -0,0 +1,9 @@
1
+ import { SqlStorage } from '@cloudflare/workers-types';
2
+ /**
3
+ * Instruments the Durable Object SqlStorage `exec` method with Sentry spans.
4
+ *
5
+ * @param sql - The SqlStorage instance to instrument
6
+ * @returns An instrumented SqlStorage instance
7
+ */
8
+ export declare function instrumentSqlStorage(sql: SqlStorage): SqlStorage;
9
+ //# sourceMappingURL=instrumentSqlStorage.d.ts.map
@@ -7,8 +7,7 @@ import { CloudflareOptions } from '../../client';
7
7
  * - DurableObjectNamespace (via `idFromName` duck-typing)
8
8
  * - Service bindings / JSRPC proxies
9
9
  * - Queue producers (via `send` + `sendBatch` duck-typing)
10
- *
11
- * Extensible for future binding types (KV, D1, etc.).
10
+ * - R2 Buckets (via `head` + `put` + `createMultipartUpload` duck-typing)
12
11
  *
13
12
  * @param env - The Cloudflare env object to instrument
14
13
  * @param options - Optional CloudflareOptions to control RPC trace propagation
@@ -0,0 +1,9 @@
1
+ import { R2Bucket } from '@cloudflare/workers-types';
2
+ /**
3
+ * Wraps a Cloudflare R2 Bucket binding to create spans on bucket operations.
4
+ *
5
+ * Instrumented methods: get, head, put, delete, list, createMultipartUpload,
6
+ * resumeMultipartUpload (and the resulting multipart upload operations).
7
+ */
8
+ export declare function instrumentR2Bucket<T extends R2Bucket>(bucket: T, bindingName: string): T;
9
+ //# sourceMappingURL=instrumentR2.d.ts.map
@@ -30,7 +30,7 @@
30
30
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
31
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
32
  */
33
- import { D1Database, DurableObjectNamespace, Queue } from '@cloudflare/workers-types';
33
+ import { D1Database, DurableObjectNamespace, Queue, R2Bucket } from '@cloudflare/workers-types';
34
34
  /**
35
35
  * Checks if a value is a JSRPC proxy (service binding).
36
36
  *
@@ -56,4 +56,9 @@ export declare function isQueue(item: unknown): item is Queue;
56
56
  * D1Database has `prepare`, `batch`, and `exec` methods.
57
57
  */
58
58
  export declare function isD1Database(item: unknown): item is D1Database;
59
+ /**
60
+ * Duck-type check for R2 Bucket bindings.
61
+ * R2Bucket has `head`, `put`, and `createMultipartUpload` methods.
62
+ */
63
+ export declare function isR2Bucket(item: unknown): item is R2Bucket;
59
64
  //# sourceMappingURL=isBinding.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/cloudflare",
3
- "version": "10.59.0",
3
+ "version": "10.61.0",
4
4
  "description": "Official Sentry SDK for Cloudflare Workers and Pages",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/cloudflare",
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@opentelemetry/api": "^1.9.1",
53
- "@sentry/core": "10.59.0"
53
+ "@sentry/core": "10.61.0"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@cloudflare/workers-types": "^4.x"