@danieljvdm/dev-kit 1.0.1 → 2.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.
- package/README.md +6 -6
- package/package.json +1 -1
- package/skill-sources.jsonc +6 -29
- package/skill-sources.lock.json +23 -109
- package/skills/animate/LICENSE +21 -0
- package/skills/animate/NOTICE +10 -0
- package/skills/animate/SKILL.md +34 -0
- package/skills/animate/references/gestures.md +27 -0
- package/skills/animate/references/glossary.md +136 -0
- package/skills/animate/references/implementation.md +22 -0
- package/skills/animate/references/opportunities.md +18 -0
- package/skills/animate/references/principles.md +48 -0
- package/skills/animate/references/review.md +19 -0
- package/skills/cloudflare-workers/LICENSE +202 -0
- package/skills/cloudflare-workers/NOTICE +9 -0
- package/skills/cloudflare-workers/SKILL.md +26 -0
- package/skills/cloudflare-workers/references/durable-objects.md +68 -0
- package/skills/cloudflare-workers/references/sandbox.md +48 -0
- package/skills/cloudflare-workers/references/workers.md +63 -0
- package/skills/cloudflare-workers/references/wrangler.md +56 -0
- package/skills/design-ui/LICENSE +21 -0
- package/skills/design-ui/NOTICE +8 -0
- package/skills/design-ui/SKILL.md +29 -0
- package/skills/design-ui/references/appearance.md +22 -0
- package/skills/design-ui/references/components.md +33 -0
- package/skills/design-ui/references/exploration.md +50 -0
- package/skills/design-ui/references/libraries.md +39 -0
- package/skills/design-ui/references/themes.md +23 -0
- package/skills/dev-kit/SKILL.md +19 -38
- package/skills/dev-kit/references/cloudflare-worker-api.md +1 -1
- package/skills/dev-kit/references/skills.md +2 -2
- package/skills/effect-development/SKILL.md +27 -0
- package/skills/effect-development/agents/openai.yaml +4 -0
- package/skills/effect-development/references/api/index.md +32 -0
- package/skills/effect-development/references/api/schema-codecs.md +15 -0
- package/skills/{build-effect-apis/references → effect-development/references/api}/verification.md +10 -5
- package/skills/{effect-architecture-audit/SKILL.md → effect-development/references/architecture/index.md} +1 -6
- package/skills/{effect-atom-state/references → effect-development/references/atom}/effect-atom-client.md +8 -6
- package/skills/{effect-atom-state/references → effect-development/references/atom}/effect-atom-testing.md +7 -2
- package/skills/effect-development/references/atom/index.md +40 -0
- package/skills/{build-effect-clis/references → effect-development/references/cli}/entrypoints-and-testing.md +6 -2
- package/skills/effect-development/references/cli/index.md +39 -0
- package/skills/effect-development/references/setup.md +15 -0
- package/skills/open-pull-request/SKILL.md +11 -115
- package/skills/open-pull-request/agents/openai.yaml +3 -3
- package/skills/open-pull-request/references/evidence.md +22 -0
- package/skills/open-pull-request/references/explanation.md +21 -0
- package/skills/open-pull-request/references/publication.md +21 -0
- package/skills/sentry/LICENSE +202 -0
- package/skills/sentry/LICENSE-UPSTREAM +21 -0
- package/skills/sentry/NOTICE +14 -0
- package/skills/sentry/SKILL.md +33 -0
- package/skills/sentry/references/alert-payloads.md +105 -0
- package/skills/sentry/references/alerts.md +17 -0
- package/skills/sentry/references/artifacts.md +25 -0
- package/skills/sentry/references/auth-token.md +65 -0
- package/skills/sentry/references/concepts/ai-monitoring.md +131 -0
- package/skills/sentry/references/concepts/choosing-a-signal.md +78 -0
- package/skills/sentry/references/concepts/crons.md +50 -0
- package/skills/sentry/references/concepts/data-scrubbing.md +43 -0
- package/skills/sentry/references/concepts/errors.md +40 -0
- package/skills/sentry/references/concepts/logging.md +85 -0
- package/skills/sentry/references/concepts/metrics.md +49 -0
- package/skills/sentry/references/concepts/monitors.md +78 -0
- package/skills/sentry/references/concepts/profiling.md +38 -0
- package/skills/sentry/references/concepts/reduce-volume.md +49 -0
- package/skills/sentry/references/concepts/releases.md +43 -0
- package/skills/sentry/references/concepts/session-replay.md +35 -0
- package/skills/sentry/references/concepts/tracing.md +54 -0
- package/skills/sentry/references/concepts/user-feedback.md +36 -0
- package/skills/sentry/references/debug-artifacts/android.md +68 -0
- package/skills/sentry/references/debug-artifacts/apple.md +96 -0
- package/skills/sentry/references/debug-artifacts/dotnet.md +70 -0
- package/skills/sentry/references/debug-artifacts/flutter.md +65 -0
- package/skills/sentry/references/debug-artifacts/index.md +75 -0
- package/skills/sentry/references/debug-artifacts/javascript.md +94 -0
- package/skills/sentry/references/debug-artifacts/matching.md +73 -0
- package/skills/sentry/references/debug-artifacts/react-native.md +75 -0
- package/skills/sentry/references/first-error-setup.md +25 -0
- package/skills/sentry/references/instrumentation.md +30 -0
- package/skills/sentry/references/issues.md +32 -0
- package/skills/sentry/references/new-project.md +17 -0
- package/skills/sentry/references/otel-exporter.md +30 -0
- package/skills/sentry/references/release-workflow.md +31 -0
- package/skills/sentry/references/releases/ci-pipeline.md +214 -0
- package/skills/sentry/references/releases/index.md +93 -0
- package/skills/sentry/references/releases/suspect-commits.md +155 -0
- package/skills/sentry/references/releases/tagging.md +131 -0
- package/skills/sentry/references/releases/troubleshooting.md +67 -0
- package/skills/sentry/references/sdks/android/crons.md +305 -0
- package/skills/sentry/references/sdks/android/error-monitoring.md +800 -0
- package/skills/sentry/references/sdks/android/index.md +748 -0
- package/skills/sentry/references/sdks/android/integrations.md +48 -0
- package/skills/sentry/references/sdks/android/logging.md +374 -0
- package/skills/sentry/references/sdks/android/metrics.md +288 -0
- package/skills/sentry/references/sdks/android/profiling.md +397 -0
- package/skills/sentry/references/sdks/android/session-replay.md +406 -0
- package/skills/sentry/references/sdks/android/tracing.md +861 -0
- package/skills/sentry/references/sdks/browser/error-monitoring.md +861 -0
- package/skills/sentry/references/sdks/browser/index.md +714 -0
- package/skills/sentry/references/sdks/browser/logging.md +315 -0
- package/skills/sentry/references/sdks/browser/profiling.md +236 -0
- package/skills/sentry/references/sdks/browser/session-replay.md +586 -0
- package/skills/sentry/references/sdks/browser/tracing.md +561 -0
- package/skills/sentry/references/sdks/browser/user-feedback.md +354 -0
- package/skills/sentry/references/sdks/cloudflare/ai-monitoring.md +661 -0
- package/skills/sentry/references/sdks/cloudflare/crons.md +231 -0
- package/skills/sentry/references/sdks/cloudflare/durable-objects.md +381 -0
- package/skills/sentry/references/sdks/cloudflare/error-monitoring.md +329 -0
- package/skills/sentry/references/sdks/cloudflare/index.md +698 -0
- package/skills/sentry/references/sdks/cloudflare/logging.md +169 -0
- package/skills/sentry/references/sdks/cloudflare/nodejs-compat.md +134 -0
- package/skills/sentry/references/sdks/cloudflare/tracing.md +475 -0
- package/skills/sentry/references/sdks/cocoa/error-monitoring.md +394 -0
- package/skills/sentry/references/sdks/cocoa/index.md +497 -0
- package/skills/sentry/references/sdks/cocoa/logging.md +209 -0
- package/skills/sentry/references/sdks/cocoa/metrics.md +136 -0
- package/skills/sentry/references/sdks/cocoa/profiling.md +223 -0
- package/skills/sentry/references/sdks/cocoa/session-replay.md +257 -0
- package/skills/sentry/references/sdks/cocoa/tracing.md +524 -0
- package/skills/sentry/references/sdks/cocoa/user-feedback.md +310 -0
- package/skills/sentry/references/sdks/dotnet/crons.md +465 -0
- package/skills/sentry/references/sdks/dotnet/error-monitoring.md +1100 -0
- package/skills/sentry/references/sdks/dotnet/index.md +614 -0
- package/skills/sentry/references/sdks/dotnet/logging.md +556 -0
- package/skills/sentry/references/sdks/dotnet/metrics.md +229 -0
- package/skills/sentry/references/sdks/dotnet/profiling.md +296 -0
- package/skills/sentry/references/sdks/dotnet/tracing.md +897 -0
- package/skills/sentry/references/sdks/elixir/crons.md +371 -0
- package/skills/sentry/references/sdks/elixir/error-monitoring.md +335 -0
- package/skills/sentry/references/sdks/elixir/index.md +383 -0
- package/skills/sentry/references/sdks/elixir/logging.md +239 -0
- package/skills/sentry/references/sdks/elixir/tracing.md +233 -0
- package/skills/sentry/references/sdks/flutter/ecosystem-integrations.md +70 -0
- package/skills/sentry/references/sdks/flutter/error-monitoring.md +312 -0
- package/skills/sentry/references/sdks/flutter/index.md +728 -0
- package/skills/sentry/references/sdks/flutter/logging.md +387 -0
- package/skills/sentry/references/sdks/flutter/metrics.md +310 -0
- package/skills/sentry/references/sdks/flutter/profiling.md +214 -0
- package/skills/sentry/references/sdks/flutter/session-replay.md +308 -0
- package/skills/sentry/references/sdks/flutter/tracing.md +502 -0
- package/skills/sentry/references/sdks/go/crons.md +270 -0
- package/skills/sentry/references/sdks/go/error-monitoring.md +361 -0
- package/skills/sentry/references/sdks/go/index.md +324 -0
- package/skills/sentry/references/sdks/go/logging.md +354 -0
- package/skills/sentry/references/sdks/go/metrics.md +273 -0
- package/skills/sentry/references/sdks/go/profiling.md +46 -0
- package/skills/sentry/references/sdks/go/tracing.md +366 -0
- package/skills/sentry/references/sdks/index.md +41 -0
- package/skills/sentry/references/sdks/nestjs/ai-monitoring.md +410 -0
- package/skills/sentry/references/sdks/nestjs/crons.md +268 -0
- package/skills/sentry/references/sdks/nestjs/error-monitoring.md +729 -0
- package/skills/sentry/references/sdks/nestjs/index.md +699 -0
- package/skills/sentry/references/sdks/nestjs/logging.md +174 -0
- package/skills/sentry/references/sdks/nestjs/metrics.md +243 -0
- package/skills/sentry/references/sdks/nestjs/profiling.md +127 -0
- package/skills/sentry/references/sdks/nestjs/tracing.md +762 -0
- package/skills/sentry/references/sdks/nextjs/ai-monitoring.md +494 -0
- package/skills/sentry/references/sdks/nextjs/crons.md +383 -0
- package/skills/sentry/references/sdks/nextjs/error-monitoring.md +974 -0
- package/skills/sentry/references/sdks/nextjs/index.md +491 -0
- package/skills/sentry/references/sdks/nextjs/logging.md +381 -0
- package/skills/sentry/references/sdks/nextjs/metrics.md +411 -0
- package/skills/sentry/references/sdks/nextjs/profiling.md +403 -0
- package/skills/sentry/references/sdks/nextjs/session-replay.md +462 -0
- package/skills/sentry/references/sdks/nextjs/tracing.md +628 -0
- package/skills/sentry/references/sdks/node/ai-monitoring.md +303 -0
- package/skills/sentry/references/sdks/node/crons.md +432 -0
- package/skills/sentry/references/sdks/node/error-monitoring.md +1125 -0
- package/skills/sentry/references/sdks/node/index.md +942 -0
- package/skills/sentry/references/sdks/node/logging.md +380 -0
- package/skills/sentry/references/sdks/node/metrics.md +278 -0
- package/skills/sentry/references/sdks/node/profiling.md +373 -0
- package/skills/sentry/references/sdks/node/tracing.md +878 -0
- package/skills/sentry/references/sdks/php/ai-monitoring.md +310 -0
- package/skills/sentry/references/sdks/php/crons.md +265 -0
- package/skills/sentry/references/sdks/php/error-monitoring.md +626 -0
- package/skills/sentry/references/sdks/php/index.md +362 -0
- package/skills/sentry/references/sdks/php/laravel.md +542 -0
- package/skills/sentry/references/sdks/php/logging.md +242 -0
- package/skills/sentry/references/sdks/php/metrics.md +193 -0
- package/skills/sentry/references/sdks/php/profiling.md +115 -0
- package/skills/sentry/references/sdks/php/symfony.md +552 -0
- package/skills/sentry/references/sdks/php/tracing.md +516 -0
- package/skills/sentry/references/sdks/python/ai-monitoring.md +351 -0
- package/skills/sentry/references/sdks/python/crons.md +218 -0
- package/skills/sentry/references/sdks/python/error-monitoring.md +292 -0
- package/skills/sentry/references/sdks/python/index.md +361 -0
- package/skills/sentry/references/sdks/python/logging.md +234 -0
- package/skills/sentry/references/sdks/python/metrics.md +154 -0
- package/skills/sentry/references/sdks/python/profiling.md +120 -0
- package/skills/sentry/references/sdks/python/tracing.md +364 -0
- package/skills/sentry/references/sdks/react/error-monitoring.md +1607 -0
- package/skills/sentry/references/sdks/react/index.md +492 -0
- package/skills/sentry/references/sdks/react/logging.md +364 -0
- package/skills/sentry/references/sdks/react/profiling.md +322 -0
- package/skills/sentry/references/sdks/react/react-features.md +1272 -0
- package/skills/sentry/references/sdks/react/session-replay.md +1193 -0
- package/skills/sentry/references/sdks/react/tracing.md +1415 -0
- package/skills/sentry/references/sdks/react-native/error-monitoring.md +1481 -0
- package/skills/sentry/references/sdks/react-native/expo-config-plugin.md +45 -0
- package/skills/sentry/references/sdks/react-native/index.md +1030 -0
- package/skills/sentry/references/sdks/react-native/logging.md +444 -0
- package/skills/sentry/references/sdks/react-native/profiling.md +386 -0
- package/skills/sentry/references/sdks/react-native/session-replay.md +704 -0
- package/skills/sentry/references/sdks/react-native/tracing.md +1086 -0
- package/skills/sentry/references/sdks/react-native/user-feedback.md +815 -0
- package/skills/sentry/references/sdks/react-router-framework/error-monitoring.md +127 -0
- package/skills/sentry/references/sdks/react-router-framework/index.md +411 -0
- package/skills/sentry/references/sdks/react-router-framework/logging.md +66 -0
- package/skills/sentry/references/sdks/react-router-framework/profiling.md +57 -0
- package/skills/sentry/references/sdks/react-router-framework/react-router-framework-features.md +110 -0
- package/skills/sentry/references/sdks/react-router-framework/session-replay.md +67 -0
- package/skills/sentry/references/sdks/react-router-framework/tracing.md +96 -0
- package/skills/sentry/references/sdks/react-router-framework/user-feedback.md +71 -0
- package/skills/sentry/references/sdks/ruby/crons.md +184 -0
- package/skills/sentry/references/sdks/ruby/error-monitoring.md +248 -0
- package/skills/sentry/references/sdks/ruby/index.md +297 -0
- package/skills/sentry/references/sdks/ruby/logging.md +168 -0
- package/skills/sentry/references/sdks/ruby/metrics.md +196 -0
- package/skills/sentry/references/sdks/ruby/migration.md +321 -0
- package/skills/sentry/references/sdks/ruby/profiling.md +107 -0
- package/skills/sentry/references/sdks/ruby/tracing.md +388 -0
- package/skills/sentry/references/sdks/svelte/error-monitoring.md +456 -0
- package/skills/sentry/references/sdks/svelte/index.md +467 -0
- package/skills/sentry/references/sdks/svelte/logging.md +344 -0
- package/skills/sentry/references/sdks/svelte/session-replay.md +369 -0
- package/skills/sentry/references/sdks/svelte/tracing.md +406 -0
- package/skills/sentry/references/sdks/tanstack-start/error-monitoring.md +149 -0
- package/skills/sentry/references/sdks/tanstack-start/index.md +381 -0
- package/skills/sentry/references/sdks/tanstack-start/logging.md +74 -0
- package/skills/sentry/references/sdks/tanstack-start/session-replay.md +76 -0
- package/skills/sentry/references/sdks/tanstack-start/tanstackstart-features.md +128 -0
- package/skills/sentry/references/sdks/tanstack-start/tracing.md +123 -0
- package/skills/sentry/references/sdks/tanstack-start/user-feedback.md +81 -0
- package/skills/sentry/references/search-query-language.md +226 -0
- package/skills/sentry/references/semantics/angular.md +7 -0
- package/skills/sentry/references/semantics/app.md +28 -0
- package/skills/sentry/references/semantics/art.md +17 -0
- package/skills/sentry/references/semantics/aws.md +43 -0
- package/skills/sentry/references/semantics/browser.md +34 -0
- package/skills/sentry/references/semantics/cache.md +12 -0
- package/skills/sentry/references/semantics/client.md +8 -0
- package/skills/sentry/references/semantics/cloud.md +12 -0
- package/skills/sentry/references/semantics/cloudflare.md +23 -0
- package/skills/sentry/references/semantics/code.md +11 -0
- package/skills/sentry/references/semantics/culture.md +11 -0
- package/skills/sentry/references/semantics/db.md +21 -0
- package/skills/sentry/references/semantics/device.md +43 -0
- package/skills/sentry/references/semantics/error.md +7 -0
- package/skills/sentry/references/semantics/event.md +8 -0
- package/skills/sentry/references/semantics/exception.md +10 -0
- package/skills/sentry/references/semantics/faas.md +19 -0
- package/skills/sentry/references/semantics/file.md +8 -0
- package/skills/sentry/references/semantics/flag.md +7 -0
- package/skills/sentry/references/semantics/gcp.md +16 -0
- package/skills/sentry/references/semantics/gen_ai.md +53 -0
- package/skills/sentry/references/semantics/general.md +11 -0
- package/skills/sentry/references/semantics/graphql.md +9 -0
- package/skills/sentry/references/semantics/grpc.md +19 -0
- package/skills/sentry/references/semantics/http.md +34 -0
- package/skills/sentry/references/semantics/index.md +63 -0
- package/skills/sentry/references/semantics/jsonrpc.md +8 -0
- package/skills/sentry/references/semantics/jvm.md +12 -0
- package/skills/sentry/references/semantics/koa.md +7 -0
- package/skills/sentry/references/semantics/logger.md +7 -0
- package/skills/sentry/references/semantics/mcp.md +37 -0
- package/skills/sentry/references/semantics/mdc.md +7 -0
- package/skills/sentry/references/semantics/messaging.md +23 -0
- package/skills/sentry/references/semantics/middleware.md +7 -0
- package/skills/sentry/references/semantics/navigation.md +9 -0
- package/skills/sentry/references/semantics/nel.md +11 -0
- package/skills/sentry/references/semantics/network.md +17 -0
- package/skills/sentry/references/semantics/os.md +15 -0
- package/skills/sentry/references/semantics/otel.md +10 -0
- package/skills/sentry/references/semantics/params.md +7 -0
- package/skills/sentry/references/semantics/process.md +14 -0
- package/skills/sentry/references/semantics/react.md +7 -0
- package/skills/sentry/references/semantics/remix.md +7 -0
- package/skills/sentry/references/semantics/resource.md +7 -0
- package/skills/sentry/references/semantics/rpc.md +10 -0
- package/skills/sentry/references/semantics/score.md +10 -0
- package/skills/sentry/references/semantics/sentry.md +69 -0
- package/skills/sentry/references/semantics/server.md +8 -0
- package/skills/sentry/references/semantics/service.md +8 -0
- package/skills/sentry/references/semantics/session.md +7 -0
- package/skills/sentry/references/semantics/state.md +7 -0
- package/skills/sentry/references/semantics/thread.md +8 -0
- package/skills/sentry/references/semantics/timber.md +7 -0
- package/skills/sentry/references/semantics/trpc.md +8 -0
- package/skills/sentry/references/semantics/ui.md +18 -0
- package/skills/sentry/references/semantics/url.md +15 -0
- package/skills/sentry/references/semantics/user.md +17 -0
- package/skills/sentry/references/semantics/user_agent.md +7 -0
- package/skills/sentry/references/semantics/vercel.md +42 -0
- package/skills/sentry/references/setup-verification.md +39 -0
- package/skills/sentry/references/snapshots/github-actions-fanout.md +206 -0
- package/skills/sentry/references/snapshots/github-actions-simple.md +102 -0
- package/skills/sentry/references/snapshots/github-actions-swift-snapshot-testing.md +118 -0
- package/skills/sentry/references/snapshots/index.md +19 -0
- package/skills/sentry/references/snapshots/snapshot-previews.md +100 -0
- package/skills/sentry/references/snapshots/snapshots.md +123 -0
- package/skills/sentry/references/snapshots/wizard-setup.md +134 -0
- package/skills/testing/LICENSE +21 -0
- package/skills/testing/NOTICE +7 -0
- package/skills/testing/SKILL.md +13 -19
- package/skills/testing/agents/openai.yaml +1 -2
- package/skills/testing/references/selection.md +23 -0
- package/skills/testing/references/tdd.md +19 -0
- package/skills/testing/references/test-design.md +17 -0
- package/src/catalog.ts +1 -7
- package/skills/build-effect-apis/SKILL.md +0 -81
- package/skills/build-effect-apis/agents/openai.yaml +0 -4
- package/skills/build-effect-clis/SKILL.md +0 -92
- package/skills/build-effect-clis/agents/openai.yaml +0 -4
- package/skills/effect-architecture-audit/agents/openai.yaml +0 -4
- package/skills/effect-atom-state/SKILL.md +0 -97
- package/skills/effect-atom-state/agents/openai.yaml +0 -4
- package/skills/effect-ts/SKILL.md +0 -35
- package/skills/effect-ts/agents/openai.yaml +0 -4
- /package/skills/{build-effect-apis/references → effect-development/references/api}/cloudflare-workers.md +0 -0
- /package/skills/{build-effect-apis/references → effect-development/references/api}/runtime-assembly.md +0 -0
- /package/skills/{build-effect-apis/references → effect-development/references/api}/server-and-middleware.md +0 -0
- /package/skills/{build-effect-apis/references → effect-development/references/api}/shared-contracts.md +0 -0
- /package/skills/{effect-architecture-audit/references → effect-development/references/architecture}/service-and-boundary-audit.md +0 -0
- /package/skills/{effect-atom-state/references → effect-development/references/atom}/effect-atom-lifecycle.md +0 -0
- /package/skills/{effect-atom-state/references → effect-development/references/atom}/effect-atom-workflows.md +0 -0
- /package/skills/{effect-atom-state/references → effect-development/references/atom}/tanstack-start.md +0 -0
- /package/skills/{build-effect-clis/references → effect-development/references/cli}/command-design.md +0 -0
- /package/skills/{build-effect-clis/references → effect-development/references/cli}/processes-and-platform.md +0 -0
|
@@ -0,0 +1,698 @@
|
|
|
1
|
+
# Sentry Cloudflare SDK
|
|
2
|
+
|
|
3
|
+
Opinionated wizard that scans your Cloudflare project and guides you through complete
|
|
4
|
+
Sentry setup for Workers, Pages, Durable Objects, Queues, Workflows, and Hono.
|
|
5
|
+
|
|
6
|
+
> **Note:** SDK versions and APIs below reflect current Sentry docs at time of writing
|
|
7
|
+
> (`@sentry/cloudflare` v10.69.0). Always verify against
|
|
8
|
+
> [docs.sentry.io/platforms/javascript/guides/cloudflare/](https://docs.sentry.io/platforms/javascript/guides/cloudflare/)
|
|
9
|
+
> before implementing.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Phase 1: Detect
|
|
14
|
+
|
|
15
|
+
Run these commands to understand the project before making any recommendations:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Detect Cloudflare project
|
|
19
|
+
ls wrangler.toml wrangler.jsonc wrangler.json 2>/dev/null
|
|
20
|
+
|
|
21
|
+
# Detect existing Sentry
|
|
22
|
+
cat package.json 2>/dev/null | grep -E '"@sentry/'
|
|
23
|
+
|
|
24
|
+
# Detect project type (Workers vs Pages)
|
|
25
|
+
ls functions/ functions/_middleware.js functions/_middleware.ts 2>/dev/null && echo "Pages detected"
|
|
26
|
+
cat wrangler.toml 2>/dev/null | grep -E 'main|pages_build_output_dir'
|
|
27
|
+
|
|
28
|
+
# Detect framework
|
|
29
|
+
cat package.json 2>/dev/null | grep -E '"hono"|"remix"|"astro"|"svelte"'
|
|
30
|
+
|
|
31
|
+
# Detect Durable Objects
|
|
32
|
+
cat wrangler.toml 2>/dev/null | grep -i 'durable_objects'
|
|
33
|
+
|
|
34
|
+
# Detect D1 databases
|
|
35
|
+
cat wrangler.toml 2>/dev/null | grep -i 'd1_databases'
|
|
36
|
+
|
|
37
|
+
# Detect Queues
|
|
38
|
+
cat wrangler.toml 2>/dev/null | grep -i 'queues'
|
|
39
|
+
|
|
40
|
+
# Detect Workflows
|
|
41
|
+
cat wrangler.toml 2>/dev/null | grep -i 'workflows'
|
|
42
|
+
|
|
43
|
+
# Detect Scheduled handlers (cron triggers)
|
|
44
|
+
cat wrangler.toml 2>/dev/null | grep -i 'crons\|triggers'
|
|
45
|
+
|
|
46
|
+
# Detect compatibility flags
|
|
47
|
+
cat wrangler.toml 2>/dev/null | grep -i 'compatibility_flags'
|
|
48
|
+
cat wrangler.jsonc 2>/dev/null | grep -i 'compatibility_flags'
|
|
49
|
+
|
|
50
|
+
# Detect AI/LLM libraries
|
|
51
|
+
cat package.json 2>/dev/null | grep -E '"openai"|"@anthropic-ai"|"ai"|"@google/genai"|"@langchain"|"langchain"'
|
|
52
|
+
|
|
53
|
+
# Detect Cloudflare Agents SDK
|
|
54
|
+
cat package.json 2>/dev/null | grep -E '"agents"|"@cloudflare/ai-chat"'
|
|
55
|
+
|
|
56
|
+
# Detect Vite build (enables build-time AI/DB instrumentation via the Sentry Vite plugin)
|
|
57
|
+
ls vite.config.ts vite.config.js vite.config.mts 2>/dev/null
|
|
58
|
+
cat package.json 2>/dev/null | grep -E '"@cloudflare/vite-plugin"'
|
|
59
|
+
|
|
60
|
+
# Detect logging libraries
|
|
61
|
+
cat package.json 2>/dev/null | grep -E '"pino"|"winston"'
|
|
62
|
+
|
|
63
|
+
# Check for companion frontend
|
|
64
|
+
ls frontend/ web/ client/ 2>/dev/null
|
|
65
|
+
cat package.json 2>/dev/null | grep -E '"react"|"vue"|"svelte"|"next"'
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**What to determine:**
|
|
69
|
+
|
|
70
|
+
| Question | Impact |
|
|
71
|
+
| -------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
72
|
+
| Workers or Pages? | Determines wrapper: `withSentry` vs `sentryPagesPlugin` |
|
|
73
|
+
| Hono framework? | Recommend standalone `@sentry/hono` package (v10.55.0+) for cleaner integration |
|
|
74
|
+
| `@sentry/cloudflare` already installed? | Skip install, go to feature config |
|
|
75
|
+
| Durable Objects configured? | Recommend `instrumentDurableObjectWithSentry` |
|
|
76
|
+
| Cloudflare Agents SDK (`agents`, `@cloudflare/ai-chat`)? | Recommend `instrumentAgentWithSentry` (v10.69.0+) — DO instrumentation plus `@callable()` RPC spans and **automatic conversation IDs**. See `./durable-objects.md` |
|
|
77
|
+
| D1 databases bound? | Auto-instrumented by `withSentry` when accessed via `env.DB` (no manual wrap) |
|
|
78
|
+
| Queues configured? | `withSentry` auto-instruments queue handlers |
|
|
79
|
+
| Workflows configured? | Recommend `instrumentWorkflowWithSentry` |
|
|
80
|
+
| Cron triggers configured? | `withSentry` auto-instruments scheduled handlers; recommend Crons monitoring |
|
|
81
|
+
| `nodejs_als` or `nodejs_compat` flag set? | **Required** — SDK needs `AsyncLocalStorage`. Recommend `nodejs_compat` generally, and with it the `@sentry/cloudflare/nodejs_compat` entrypoint (drop-in swap, unlocks Prisma + Vercel AI SDK v7, becomes default in v11) |
|
|
82
|
+
| Prisma ORM used? | Recommend `prismaIntegration` via the `/nodejs_compat` entrypoint — see `./nodejs-compat.md` |
|
|
83
|
+
| Workers AI (`env.AI`) used? | Auto-instrumented by `withSentry` — creates `gen_ai` spans (v10.67.0+). **Chat-style app?** Also wire `Sentry.setConversationId()` so multi-turn sessions group in Conversations (automatic for Agents SDK classes wrapped with `instrumentAgentWithSentry`, v10.69.0+) — see `./ai-monitoring.md` |
|
|
84
|
+
| AI/LLM libraries? | Recommend Agent Tracing — see `./ai-monitoring.md`. On workerd, `openai`/`@anthropic-ai/sdk`/`@google/genai` need the Vite plugin or manual client wrapping |
|
|
85
|
+
| Builds with Vite (or could)? | Recommend `sentryCloudflareVitePlugin` (v10.68.0+, experimental) — build-time instrumentation of bundled AI/DB packages. See `./ai-monitoring.md` |
|
|
86
|
+
| Companion frontend? | Trigger Phase 4 cross-link |
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Phase 2: Recommend
|
|
91
|
+
|
|
92
|
+
Present a concrete recommendation based on what you found.
|
|
93
|
+
Don’t ask open-ended questions — lead with a proposal:
|
|
94
|
+
|
|
95
|
+
**Recommended (core coverage):**
|
|
96
|
+
|
|
97
|
+
- ✅ **Error Monitoring** — always; captures unhandled exceptions in fetch, scheduled,
|
|
98
|
+
queue, email, and Durable Object handlers
|
|
99
|
+
- ✅ **Tracing** — automatic HTTP request spans, outbound fetch tracing, D1 query spans
|
|
100
|
+
|
|
101
|
+
**Optional (enhanced observability):**
|
|
102
|
+
|
|
103
|
+
- ⚡ **Logging** — structured logs via `Sentry.logger.*`; recommend when log search is
|
|
104
|
+
needed
|
|
105
|
+
- ⚡ **Crons** — detect missed/failed scheduled jobs; recommend when cron triggers are
|
|
106
|
+
configured
|
|
107
|
+
- ⚡ **D1 Instrumentation** — automatic query spans and breadcrumbs; recommend when D1 is
|
|
108
|
+
bound
|
|
109
|
+
- ⚡ **Durable Objects** — automatic error capture and spans for DO methods; recommend
|
|
110
|
+
when DOs are configured
|
|
111
|
+
- ⚡ **Workflows** — automatic span creation for workflow steps; recommend when Workflows
|
|
112
|
+
are configured
|
|
113
|
+
- ⚡ **AI / Agent Tracing** — Workers AI, OpenAI, Anthropic, Google Gen AI, Vercel AI
|
|
114
|
+
SDK, LangChain, LangGraph; recommend when AI libraries or `env.AI` detected.
|
|
115
|
+
For chat apps, include conversation tracking (`setConversationId`) in the same pass —
|
|
116
|
+
spans alone leave the Conversations view empty
|
|
117
|
+
|
|
118
|
+
**Recommendation logic:**
|
|
119
|
+
|
|
120
|
+
| Feature | Recommend when … |
|
|
121
|
+
| ------------------ | -------------------------------------------------------------------------------------------------------- |
|
|
122
|
+
| Error Monitoring | **Always** — non-negotiable baseline |
|
|
123
|
+
| Tracing | **Always** — HTTP request tracing and outbound fetch are high-value |
|
|
124
|
+
| Logging | App needs structured log search or log-to-trace correlation |
|
|
125
|
+
| Crons | Cron triggers configured in `wrangler.toml` |
|
|
126
|
+
| D1 Instrumentation | D1 database bindings present |
|
|
127
|
+
| Durable Objects | Durable Object bindings configured |
|
|
128
|
+
| Workflows | Workflow bindings configured |
|
|
129
|
+
| AI / Agent Tracing | App uses Workers AI (`env.AI`), OpenAI, Anthropic, Google Gen AI, Vercel AI SDK, LangChain, or LangGraph |
|
|
130
|
+
| Metrics | App needs custom counters, gauges, or distributions |
|
|
131
|
+
|
|
132
|
+
Propose: _“I recommend setting up Error Monitoring + Tracing.
|
|
133
|
+
Want me to also add D1 instrumentation and Crons monitoring?”_
|
|
134
|
+
|
|
135
|
+
**Exception — AI apps:** when Workers AI or an LLM SDK is detected, conversation
|
|
136
|
+
tracking is **not optional** — include it in the baseline proposal alongside Error
|
|
137
|
+
Monitoring + Tracing, and implement it in the same pass (see `./ai-monitoring.md`). An
|
|
138
|
+
AI setup that produces spans but no Conversations is incomplete.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Phase 3: Guide
|
|
143
|
+
|
|
144
|
+
### Option 1: Source Maps Wizard
|
|
145
|
+
|
|
146
|
+
> **You need to run this yourself** — the wizard opens a browser for login and requires
|
|
147
|
+
> interactive input that the agent can’t handle.
|
|
148
|
+
> Copy-paste into your terminal:
|
|
149
|
+
>
|
|
150
|
+
> ```
|
|
151
|
+
> npx @sentry/wizard@latest -i sourcemaps
|
|
152
|
+
> ```
|
|
153
|
+
>
|
|
154
|
+
> This sets up source map uploading so your production stack traces show readable code.
|
|
155
|
+
> It does **not** set up the SDK initialization — you still need to follow Option 2
|
|
156
|
+
> below for the actual SDK setup.
|
|
157
|
+
>
|
|
158
|
+
> **Once it finishes, continue with Option 2 for SDK setup.**
|
|
159
|
+
|
|
160
|
+
> **Note:** Unlike framework SDKs (Next.js, SvelteKit), there is no Cloudflare-specific
|
|
161
|
+
> wizard integration. The `sourcemaps` wizard only handles source map upload
|
|
162
|
+
> configuration.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
### Option 2: Manual Setup
|
|
167
|
+
|
|
168
|
+
#### Prerequisites: Compatibility Flags
|
|
169
|
+
|
|
170
|
+
The SDK requires `AsyncLocalStorage`. Add **one** of these flags to your Wrangler
|
|
171
|
+
config:
|
|
172
|
+
|
|
173
|
+
**wrangler.toml:**
|
|
174
|
+
|
|
175
|
+
```toml
|
|
176
|
+
compatibility_flags = ["nodejs_als"]
|
|
177
|
+
# or: compatibility_flags = ["nodejs_compat"]
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
**wrangler.jsonc:**
|
|
181
|
+
|
|
182
|
+
```jsonc
|
|
183
|
+
{
|
|
184
|
+
"compatibility_flags": ["nodejs_als"],
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
> `nodejs_als` is the minimum — it only enables `AsyncLocalStorage`. **`nodejs_compat`
|
|
189
|
+
> is generally recommended:** it’s a superset of `nodejs_als` and unlocks the
|
|
190
|
+
> `/nodejs_compat` entrypoint below (more integrations and features), which becomes the
|
|
191
|
+
> SDK default in v11. Prefer `nodejs_compat` unless you have a specific reason to keep
|
|
192
|
+
> the runtime minimal.
|
|
193
|
+
|
|
194
|
+
#### `/nodejs_compat` Entrypoint (recommended)
|
|
195
|
+
|
|
196
|
+
When your Worker runs with the `nodejs_compat` flag, use the dedicated
|
|
197
|
+
`@sentry/cloudflare/nodejs_compat` entrypoint instead of the default one.
|
|
198
|
+
It’s a drop-in import swap — everything (`withSentry`, `sentryPagesPlugin`, etc.)
|
|
199
|
+
works the same — but it unlocks additional Node.js-only functionality on Cloudflare,
|
|
200
|
+
such as the `prismaIntegration` and Vercel AI SDK v7 support:
|
|
201
|
+
|
|
202
|
+
```typescript
|
|
203
|
+
// Drop-in replacement — everything else works the same
|
|
204
|
+
import * as Sentry from "@sentry/cloudflare/nodejs_compat";
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**For new projects, default to this entrypoint** (add the `nodejs_compat` flag and
|
|
208
|
+
import from `@sentry/cloudflare/nodejs_compat` from the start).
|
|
209
|
+
Requires SDK v10.64.0+. It becomes the **default entrypoint in v11**, so adopting it now
|
|
210
|
+
is the recommended path and eases the upgrade.
|
|
211
|
+
See `./nodejs-compat.md` for full setup (Prisma).
|
|
212
|
+
|
|
213
|
+
#### Install
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
npm install @sentry/cloudflare
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
#### Workers Setup
|
|
220
|
+
|
|
221
|
+
Wrap your handler with `withSentry`. This automatically instruments `fetch`,
|
|
222
|
+
`scheduled`, `queue`, `email`, and `tail` handlers:
|
|
223
|
+
|
|
224
|
+
```typescript
|
|
225
|
+
import * as Sentry from "@sentry/cloudflare";
|
|
226
|
+
|
|
227
|
+
export default Sentry.withSentry(
|
|
228
|
+
(env: Env) => ({
|
|
229
|
+
dsn: env.SENTRY_DSN,
|
|
230
|
+
tracesSampleRate: 1.0,
|
|
231
|
+
enableLogs: true,
|
|
232
|
+
dataCollection: {
|
|
233
|
+
// To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:
|
|
234
|
+
// https://docs.sentry.io/platforms/javascript/guides/cloudflare/configuration/options/#dataCollection
|
|
235
|
+
// userInfo: false,
|
|
236
|
+
// httpBodies: [],
|
|
237
|
+
},
|
|
238
|
+
}),
|
|
239
|
+
{
|
|
240
|
+
async fetch(request, env, ctx) {
|
|
241
|
+
return new Response("Hello World!");
|
|
242
|
+
},
|
|
243
|
+
} satisfies ExportedHandler<Env>,
|
|
244
|
+
);
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
**Key points:**
|
|
248
|
+
|
|
249
|
+
- The first argument is a callback that receives `env` — use this to read secrets like
|
|
250
|
+
`SENTRY_DSN`
|
|
251
|
+
- The SDK reads DSN, environment, release, debug, tunnel, and traces sample rate from
|
|
252
|
+
`env` automatically (see [Environment Variables](#environment-variables))
|
|
253
|
+
- `withSentry` wraps all exported handlers — you do not need separate wrappers for
|
|
254
|
+
`scheduled`, `queue`, etc.
|
|
255
|
+
|
|
256
|
+
#### AI apps: set a conversation ID (required, same edit)
|
|
257
|
+
|
|
258
|
+
If this Worker makes AI calls (`env.AI.run(...)` or an LLM SDK), `withSentry` gives you
|
|
259
|
+
`gen_ai` spans automatically — but **never a conversation ID**, so multi-turn chats
|
|
260
|
+
won’t group and Sentry’s Conversations view stays empty.
|
|
261
|
+
This is part of the Workers setup, not a follow-up: add `Sentry.setConversationId()` in
|
|
262
|
+
the same edit that adds `withSentry`. (Exception: Cloudflare Agents SDK classes wrapped
|
|
263
|
+
with `instrumentAgentWithSentry` get conversation IDs automatically, v10.69.0+ — see
|
|
264
|
+
`./durable-objects.md`.)
|
|
265
|
+
|
|
266
|
+
1. The client generates a stable session ID once per chat session (e.g.
|
|
267
|
+
`crypto.randomUUID()`) and sends it with every AI request
|
|
268
|
+
2. The handler sets it **before** any AI calls:
|
|
269
|
+
|
|
270
|
+
```typescript
|
|
271
|
+
async fetch(request, env, ctx) {
|
|
272
|
+
const { conversationId, messages } = await request.json();
|
|
273
|
+
Sentry.setConversationId(conversationId); // before env.AI.run / LLM calls
|
|
274
|
+
|
|
275
|
+
const result = await env.AI.run("@cf/meta/llama-3.1-8b-instruct", { messages });
|
|
276
|
+
return new Response(JSON.stringify(result));
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
See `./ai-monitoring.md` for user attribution (`setUser`), the Agents SDK pattern, and
|
|
281
|
+
non-Workers-AI providers.
|
|
282
|
+
|
|
283
|
+
#### Automatic Binding Instrumentation
|
|
284
|
+
|
|
285
|
+
`withSentry` (and `sentryPagesPlugin`) wraps the `env` object so that supported bindings
|
|
286
|
+
are **automatically instrumented on access** — no manual wrapping needed.
|
|
287
|
+
As long as your handler uses the `env` passed in by the SDK:
|
|
288
|
+
|
|
289
|
+
| Binding | Auto-instrumented | Docs status |
|
|
290
|
+
| ------------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------- |
|
|
291
|
+
| **D1** (`env.DB`) | Query spans + breadcrumbs | Documented |
|
|
292
|
+
| **Workers AI** (`env.AI`) | `gen_ai` spans (v10.67.0+) — spans only; conversation grouping needs the extra step below | Documented |
|
|
293
|
+
| **Queue producers** | Producer send spans | Verified in SDK source; not yet in published docs |
|
|
294
|
+
| **R2 buckets** | Object operation spans | Verified in SDK source; not yet in published docs |
|
|
295
|
+
| **RateLimit** | `limit()` spans | Verified in SDK source; not yet in published docs |
|
|
296
|
+
|
|
297
|
+
> **Required step for AI apps:** auto-instrumentation produces `gen_ai` spans but never
|
|
298
|
+
> sets a conversation ID, so multi-turn chats don’t group and Sentry’s Conversations
|
|
299
|
+
> view stays empty. If the app makes AI calls (`env.AI` or an LLM SDK), wiring
|
|
300
|
+
> `Sentry.setConversationId()` is part of _this_ setup — do it in the same edit as
|
|
301
|
+
> `withSentry`, don’t defer it.
|
|
302
|
+
> Read `./ai-monitoring.md` (Tracking Conversations) for the pattern: client generates a
|
|
303
|
+
> stable session ID, handler calls `Sentry.setConversationId(id)` before any AI calls.
|
|
304
|
+
> Skipping this is the most common gap in Cloudflare AI setups.
|
|
305
|
+
>
|
|
306
|
+
> Because D1 is auto-instrumented via `env`, the manual `instrumentD1WithSentry` wrapper
|
|
307
|
+
> is no longer needed (it’s deprecated and slated for removal in v11). See
|
|
308
|
+
> `./durable-objects.md`.
|
|
309
|
+
>
|
|
310
|
+
> To link Durable Object and service-binding (JSRPC) calls into one trace, set
|
|
311
|
+
> `enableRpcTracePropagation: true` on both caller and receiver — **recommended**
|
|
312
|
+
> whenever you use RPC, Durable Objects, or Workflows.
|
|
313
|
+
> See [RPC Trace Propagation](#configuration-reference) and `./tracing.md`.
|
|
314
|
+
|
|
315
|
+
#### Pages Setup
|
|
316
|
+
|
|
317
|
+
Use `sentryPagesPlugin` as middleware:
|
|
318
|
+
|
|
319
|
+
```typescript
|
|
320
|
+
// functions/_middleware.ts
|
|
321
|
+
import * as Sentry from "@sentry/cloudflare";
|
|
322
|
+
|
|
323
|
+
export const onRequest = Sentry.sentryPagesPlugin((context) => ({
|
|
324
|
+
dsn: context.env.SENTRY_DSN,
|
|
325
|
+
tracesSampleRate: 1.0,
|
|
326
|
+
enableLogs: true,
|
|
327
|
+
dataCollection: {
|
|
328
|
+
// To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:
|
|
329
|
+
// https://docs.sentry.io/platforms/javascript/guides/cloudflare/configuration/options/#dataCollection
|
|
330
|
+
// userInfo: false,
|
|
331
|
+
// httpBodies: [],
|
|
332
|
+
},
|
|
333
|
+
}));
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
**Chaining multiple middlewares:**
|
|
337
|
+
|
|
338
|
+
```typescript
|
|
339
|
+
import * as Sentry from "@sentry/cloudflare";
|
|
340
|
+
|
|
341
|
+
export const onRequest = [
|
|
342
|
+
// Sentry must be first
|
|
343
|
+
Sentry.sentryPagesPlugin((context) => ({
|
|
344
|
+
dsn: context.env.SENTRY_DSN,
|
|
345
|
+
tracesSampleRate: 1.0,
|
|
346
|
+
})),
|
|
347
|
+
// Add more middlewares here
|
|
348
|
+
];
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
**Using `wrapRequestHandler` directly** (for frameworks like SvelteKit on Cloudflare
|
|
352
|
+
Pages):
|
|
353
|
+
|
|
354
|
+
```typescript
|
|
355
|
+
import * as Sentry from "@sentry/cloudflare";
|
|
356
|
+
|
|
357
|
+
export const handle = ({ event, resolve }) => {
|
|
358
|
+
return Sentry.wrapRequestHandler(
|
|
359
|
+
{
|
|
360
|
+
options: {
|
|
361
|
+
dsn: event.platform.env.SENTRY_DSN,
|
|
362
|
+
tracesSampleRate: 1.0,
|
|
363
|
+
},
|
|
364
|
+
request: event.request,
|
|
365
|
+
context: event.platform.ctx,
|
|
366
|
+
},
|
|
367
|
+
() => resolve(event),
|
|
368
|
+
);
|
|
369
|
+
};
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
#### Hono on Cloudflare Workers
|
|
373
|
+
|
|
374
|
+
**Recommended (v10.55.0+):** Use the standalone `@sentry/hono` package for Hono apps:
|
|
375
|
+
|
|
376
|
+
```bash
|
|
377
|
+
npm install @sentry/hono @sentry/cloudflare
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
The `@sentry/cloudflare` package is a peer dependency and must stay in sync with
|
|
381
|
+
`@sentry/hono`.
|
|
382
|
+
|
|
383
|
+
```typescript
|
|
384
|
+
import { Hono } from "hono";
|
|
385
|
+
import { sentry } from "@sentry/hono/cloudflare";
|
|
386
|
+
|
|
387
|
+
type Bindings = { SENTRY_DSN: string };
|
|
388
|
+
|
|
389
|
+
const app = new Hono<{ Bindings: Bindings }>();
|
|
390
|
+
|
|
391
|
+
// Initialize Sentry middleware as early as possible
|
|
392
|
+
app.use(
|
|
393
|
+
sentry(app, (env) => ({
|
|
394
|
+
dsn: env.SENTRY_DSN,
|
|
395
|
+
tracesSampleRate: 1.0,
|
|
396
|
+
})),
|
|
397
|
+
);
|
|
398
|
+
|
|
399
|
+
app.get("/", (ctx) => ctx.json({ message: "Hello" }));
|
|
400
|
+
|
|
401
|
+
app.get("/error", () => {
|
|
402
|
+
throw new Error("Test error");
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
export default app;
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
The `sentry()` middleware automatically captures errors and creates transaction spans
|
|
409
|
+
with route patterns.
|
|
410
|
+
|
|
411
|
+
**Legacy approach (deprecated):** Using `@sentry/cloudflare` with `withSentry` still
|
|
412
|
+
works, but `honoIntegration` is deprecated:
|
|
413
|
+
|
|
414
|
+
```typescript
|
|
415
|
+
import { Hono } from "hono";
|
|
416
|
+
import * as Sentry from "@sentry/cloudflare";
|
|
417
|
+
|
|
418
|
+
const app = new Hono();
|
|
419
|
+
|
|
420
|
+
app.get("/", (ctx) => ctx.json({ message: "Hello" }));
|
|
421
|
+
|
|
422
|
+
export default Sentry.withSentry(
|
|
423
|
+
(env: Env) => ({
|
|
424
|
+
dsn: env.SENTRY_DSN,
|
|
425
|
+
tracesSampleRate: 1.0,
|
|
426
|
+
}),
|
|
427
|
+
app,
|
|
428
|
+
);
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
#### Set Up the SENTRY_DSN Secret
|
|
432
|
+
|
|
433
|
+
Store your DSN as a Cloudflare secret — do not hardcode it:
|
|
434
|
+
|
|
435
|
+
```bash
|
|
436
|
+
# Local development: add to .dev.vars
|
|
437
|
+
echo 'SENTRY_DSN="https://examplePublicKey@o0.ingest.sentry.io/0"' >> .dev.vars
|
|
438
|
+
|
|
439
|
+
# Production: set as a secret
|
|
440
|
+
npx wrangler secret put SENTRY_DSN
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
Add the binding to your `Env` type:
|
|
444
|
+
|
|
445
|
+
```typescript
|
|
446
|
+
interface Env {
|
|
447
|
+
SENTRY_DSN: string;
|
|
448
|
+
// ... other bindings
|
|
449
|
+
}
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
#### Source Maps Setup
|
|
453
|
+
|
|
454
|
+
Source maps make production stack traces readable.
|
|
455
|
+
Most Cloudflare projects build with Vite via Wrangler — wire the Sentry Vite plugin so
|
|
456
|
+
maps upload on build:
|
|
457
|
+
|
|
458
|
+
```bash
|
|
459
|
+
npm install @sentry/vite-plugin --save-dev
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
```typescript
|
|
463
|
+
import { defineConfig } from "vite";
|
|
464
|
+
import { sentryVitePlugin } from "@sentry/vite-plugin";
|
|
465
|
+
|
|
466
|
+
export default defineConfig({
|
|
467
|
+
build: {
|
|
468
|
+
sourcemap: true,
|
|
469
|
+
},
|
|
470
|
+
plugins: [
|
|
471
|
+
sentryVitePlugin({
|
|
472
|
+
org: "___ORG_SLUG___",
|
|
473
|
+
project: "___PROJECT_SLUG___",
|
|
474
|
+
authToken: process.env.SENTRY_AUTH_TOKEN,
|
|
475
|
+
}),
|
|
476
|
+
],
|
|
477
|
+
});
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
`SENTRY_AUTH_TOKEN` is a build-time secret.
|
|
481
|
+
The `npx @sentry/wizard@latest -i sourcemaps` shortcut noted above automates this setup.
|
|
482
|
+
|
|
483
|
+
> Don’t confuse `@sentry/vite-plugin` (`sentryVitePlugin` — source map upload) with
|
|
484
|
+
> `sentryCloudflareVitePlugin` from `@sentry/cloudflare/vite` (build-time
|
|
485
|
+
> instrumentation of bundled AI/DB dependencies, v10.68.0+ experimental).
|
|
486
|
+
> They are complementary and can run in the same `vite.config.ts`. See
|
|
487
|
+
> `./ai-monitoring.md` for the latter.
|
|
488
|
+
|
|
489
|
+
---
|
|
490
|
+
|
|
491
|
+
### Automatic Release Detection
|
|
492
|
+
|
|
493
|
+
The SDK can automatically detect the release version via Cloudflare’s version metadata
|
|
494
|
+
binding:
|
|
495
|
+
|
|
496
|
+
**wrangler.toml:**
|
|
497
|
+
|
|
498
|
+
```toml
|
|
499
|
+
[version_metadata]
|
|
500
|
+
binding = "CF_VERSION_METADATA"
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
Release priority (highest to lowest):
|
|
504
|
+
|
|
505
|
+
1. `release` option passed to `Sentry.init()`
|
|
506
|
+
2. `SENTRY_RELEASE` environment variable
|
|
507
|
+
3. `CF_VERSION_METADATA.id` binding
|
|
508
|
+
|
|
509
|
+
---
|
|
510
|
+
|
|
511
|
+
### For Each Agreed Feature
|
|
512
|
+
|
|
513
|
+
Load the corresponding reference file and follow its steps:
|
|
514
|
+
|
|
515
|
+
| Feature | Reference file | Load when … |
|
|
516
|
+
| -------------------------------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
|
517
|
+
| Error Monitoring | `./error-monitoring.md` | Always (baseline) — unhandled exceptions, manual capture, scopes, enrichment |
|
|
518
|
+
| Tracing | `./tracing.md` | HTTP request tracing, outbound fetch spans, D1/Workers AI spans, distributed tracing, RPC trace propagation |
|
|
519
|
+
| Logging | `./logging.md` | Structured logs via `Sentry.logger.*`, log-to-trace correlation |
|
|
520
|
+
| Crons | `./crons.md` | Scheduled handler monitoring, `withMonitor`, check-in API |
|
|
521
|
+
| Durable Objects / Workflows / D1 | `./durable-objects.md` | Instrument Durable Object and Workflow classes; D1 auto-instrumentation |
|
|
522
|
+
| AI / Agent Tracing | `./ai-monitoring.md` | AI/LLM libraries or Workers AI detected — `gen_ai` spans, Vite plugin build-time instrumentation, Conversations, manual agent spans |
|
|
523
|
+
| Node.js Compat | `./nodejs-compat.md` | `nodejs_compat` flag set, or Prisma / Vercel AI SDK v7 detected — `/nodejs_compat` entrypoint, `prismaIntegration` |
|
|
524
|
+
|
|
525
|
+
For each feature: read the reference file, follow its steps exactly, and verify before
|
|
526
|
+
moving on.
|
|
527
|
+
|
|
528
|
+
---
|
|
529
|
+
|
|
530
|
+
## Configuration Reference
|
|
531
|
+
|
|
532
|
+
### `Sentry.init()` Options
|
|
533
|
+
|
|
534
|
+
| Option | Type | Default | Notes |
|
|
535
|
+
| ---------------------------- | --------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
536
|
+
| `dsn` | `string` | — | Required. Read from `env.SENTRY_DSN` automatically if not set |
|
|
537
|
+
| `tracesSampleRate` | `number` | — | 0–1; 1.0 in dev, lower in prod recommended |
|
|
538
|
+
| `tracesSampler` | `function` | — | Dynamic sampling function; mutually exclusive with `tracesSampleRate` |
|
|
539
|
+
| `dataCollection` | `object` | `{}` | Controls what data the SDK captures (`userInfo`, `httpBodies`, etc.). See [Data Collection Reference](#data-collection-reference) |
|
|
540
|
+
| `sendDefaultPii` | `boolean` | `false` | Legacy. Prefer `dataCollection` for control over captured data |
|
|
541
|
+
| `enableLogs` | `boolean` | `false` | Enable Sentry Logs product |
|
|
542
|
+
| `environment` | `string` | auto | Read from `env.SENTRY_ENVIRONMENT` if not set |
|
|
543
|
+
| `release` | `string` | auto | Detected from `CF_VERSION_METADATA.id` or `SENTRY_RELEASE` |
|
|
544
|
+
| `debug` | `boolean` | `false` | Read from `env.SENTRY_DEBUG` if not set. Log SDK activity to console |
|
|
545
|
+
| `tunnel` | `string` | — | Read from `env.SENTRY_TUNNEL` if not set |
|
|
546
|
+
| `beforeSend` | `function` | — | Filter/modify error events before sending |
|
|
547
|
+
| `beforeSendTransaction` | `function` | — | Filter/modify transaction events before sending |
|
|
548
|
+
| `beforeSendLog` | `function` | — | Filter/modify log entries before sending |
|
|
549
|
+
| `tracePropagationTargets` | `(string\|RegExp)[]` | all URLs | Control which outbound requests get trace headers |
|
|
550
|
+
| `skipOpenTelemetrySetup` | `boolean` | `false` | Opt-out of OpenTelemetry compatibility tracer |
|
|
551
|
+
| `instrumentPrototypeMethods` | `boolean \| string[]` | `false` | Durable Object: instrument prototype methods for RPC spans |
|
|
552
|
+
| `enableRpcTracePropagation` | `boolean` | `false` | Links RPC calls (Worker↔DO, Worker↔Worker service bindings) into one trace. **Recommended** when using RPC / Durable Objects / Workflows — set on **both** caller and receiver (v10.52.0+). See `./tracing.md` |
|
|
553
|
+
|
|
554
|
+
### Data Collection Reference
|
|
555
|
+
|
|
556
|
+
```typescript
|
|
557
|
+
dataCollection: {
|
|
558
|
+
// To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:
|
|
559
|
+
// https://docs.sentry.io/platforms/javascript/configuration/options/#dataCollection
|
|
560
|
+
// userInfo: false,
|
|
561
|
+
// httpBodies: [],
|
|
562
|
+
},
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
### Environment Variables (Read from `env`)
|
|
566
|
+
|
|
567
|
+
The SDK reads these from the Cloudflare `env` object automatically:
|
|
568
|
+
|
|
569
|
+
| Variable | Purpose |
|
|
570
|
+
| --------------------------- | ----------------------------------------------------------- |
|
|
571
|
+
| `SENTRY_DSN` | DSN for Sentry init |
|
|
572
|
+
| `SENTRY_RELEASE` | Release version string |
|
|
573
|
+
| `SENTRY_ENVIRONMENT` | Environment name (`production`, `staging`) |
|
|
574
|
+
| `SENTRY_TRACES_SAMPLE_RATE` | Traces sample rate (parsed as float) |
|
|
575
|
+
| `SENTRY_DEBUG` | Enable debug mode (`"true"` / `"1"`) |
|
|
576
|
+
| `SENTRY_TUNNEL` | Tunnel URL for event proxying |
|
|
577
|
+
| `CF_VERSION_METADATA` | Cloudflare version metadata binding (auto-detected release) |
|
|
578
|
+
|
|
579
|
+
### Default Integrations
|
|
580
|
+
|
|
581
|
+
These are registered automatically by `getDefaultIntegrations()`:
|
|
582
|
+
|
|
583
|
+
| Integration | Purpose |
|
|
584
|
+
| ----------------------------- | ------------------------------------------------------------------------------------------------------- |
|
|
585
|
+
| `dedupeIntegration` | Prevent duplicate events (disabled for Workflows) |
|
|
586
|
+
| `inboundFiltersIntegration` | Filter events by type, message, URL |
|
|
587
|
+
| `functionToStringIntegration` | Preserve original function names |
|
|
588
|
+
| `conversationIdIntegration` | Stamp `gen_ai.conversation.id` (set via `setConversationId`) onto AI spans |
|
|
589
|
+
| `linkedErrorsIntegration` | Follow `cause` chains in errors |
|
|
590
|
+
| `fetchIntegration` | Trace outbound `fetch()` calls, create breadcrumbs |
|
|
591
|
+
| `honoIntegration` | **Deprecated in v10.55.0** — use `@sentry/hono` package instead. Auto-capture Hono `onError` exceptions |
|
|
592
|
+
| `httpServerIntegration` | Incoming HTTP request handling |
|
|
593
|
+
| `requestDataIntegration` | Attach request data to events |
|
|
594
|
+
| `consoleIntegration` | Capture `console.*` calls as breadcrumbs |
|
|
595
|
+
|
|
596
|
+
> **Not default:** `prismaIntegration` is available on Cloudflare **only** via the
|
|
597
|
+
> `@sentry/cloudflare/nodejs_compat` entrypoint and must be added manually (see
|
|
598
|
+
> `./nodejs-compat.md`). `spotlightIntegration` (v10.69.0+) forwards events to a local
|
|
599
|
+
> [Spotlight](https://spotlightjs.com/) sidecar for local development — add it manually
|
|
600
|
+
> in dev:
|
|
601
|
+
>
|
|
602
|
+
> ```typescript
|
|
603
|
+
> integrations: [Sentry.spotlightIntegration()], // default sidecar: http://localhost:8969/stream
|
|
604
|
+
> ```
|
|
605
|
+
|
|
606
|
+
---
|
|
607
|
+
|
|
608
|
+
## Verification
|
|
609
|
+
|
|
610
|
+
After setup, verify Sentry is working:
|
|
611
|
+
|
|
612
|
+
```typescript
|
|
613
|
+
// Add temporarily to your fetch handler, then remove
|
|
614
|
+
export default Sentry.withSentry(
|
|
615
|
+
(env: Env) => ({
|
|
616
|
+
dsn: env.SENTRY_DSN,
|
|
617
|
+
tracesSampleRate: 1.0,
|
|
618
|
+
}),
|
|
619
|
+
{
|
|
620
|
+
async fetch(request, env, ctx) {
|
|
621
|
+
throw new Error("Sentry test error — delete me");
|
|
622
|
+
},
|
|
623
|
+
} satisfies ExportedHandler<Env>,
|
|
624
|
+
);
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
Deploy and trigger the route, then check your
|
|
628
|
+
[Sentry Issues dashboard](https://sentry.io/issues/) — the error should appear within
|
|
629
|
+
~30 seconds.
|
|
630
|
+
|
|
631
|
+
**Verification checklist:**
|
|
632
|
+
|
|
633
|
+
| Check | How |
|
|
634
|
+
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
|
|
635
|
+
| Errors captured | Throw in a fetch handler, verify in Sentry |
|
|
636
|
+
| Tracing working | Check Performance tab for HTTP spans |
|
|
637
|
+
| Source maps working | Check stack trace shows readable file/line names |
|
|
638
|
+
| D1 spans (if configured) | Run a D1 query via `env.DB` (auto-instrumented), check for `db.query` spans |
|
|
639
|
+
| Workers AI spans (if configured) | Call `env.AI.run(...)`, check for `gen_ai` spans (see `./ai-monitoring.md`) |
|
|
640
|
+
| Conversations (chat apps) | Send two requests with the same `Sentry.setConversationId(...)` value, check they group in Explore > Conversations |
|
|
641
|
+
| Scheduled monitoring (if configured) | Trigger a cron, check Crons dashboard |
|
|
642
|
+
|
|
643
|
+
---
|
|
644
|
+
|
|
645
|
+
## Phase 4: Cross-Link
|
|
646
|
+
|
|
647
|
+
After completing Cloudflare setup, check for companion services:
|
|
648
|
+
|
|
649
|
+
```bash
|
|
650
|
+
# Check for companion frontend
|
|
651
|
+
ls frontend/ web/ client/ ui/ 2>/dev/null
|
|
652
|
+
cat package.json 2>/dev/null | grep -E '"react"|"vue"|"svelte"|"next"|"astro"'
|
|
653
|
+
|
|
654
|
+
# Check for companion backend in adjacent directories
|
|
655
|
+
ls ../backend ../server ../api 2>/dev/null
|
|
656
|
+
cat ../go.mod ../requirements.txt ../Gemfile 2>/dev/null | head -3
|
|
657
|
+
```
|
|
658
|
+
|
|
659
|
+
If a frontend is found, suggest the matching SDK skill:
|
|
660
|
+
|
|
661
|
+
| Frontend detected | Suggest skill |
|
|
662
|
+
| ----------------- | -------------------------------------------------------------------------------------------------------------- |
|
|
663
|
+
| React | [`react`](../react/index.md) |
|
|
664
|
+
| Next.js | [`nextjs`](../nextjs/index.md) |
|
|
665
|
+
| Svelte/SvelteKit | [`svelte`](../svelte/index.md) |
|
|
666
|
+
| Vue/Nuxt | See [docs.sentry.io/platforms/javascript/guides/vue/](https://docs.sentry.io/platforms/javascript/guides/vue/) |
|
|
667
|
+
|
|
668
|
+
If a backend is found in a different directory:
|
|
669
|
+
|
|
670
|
+
| Backend detected | Suggest skill |
|
|
671
|
+
| --------------------------------------------- | ------------------------------ |
|
|
672
|
+
| Go (`go.mod`) | [`go`](../go/index.md) |
|
|
673
|
+
| Python (`requirements.txt`, `pyproject.toml`) | [`python`](../python/index.md) |
|
|
674
|
+
| Ruby (`Gemfile`) | [`ruby`](../ruby/index.md) |
|
|
675
|
+
| Node.js (Express, Fastify) | [`node`](../node/index.md) |
|
|
676
|
+
|
|
677
|
+
Connecting frontend and backend with linked Sentry projects enables **distributed
|
|
678
|
+
tracing** — stack traces that span your browser, Cloudflare Worker, and backend API in a
|
|
679
|
+
single trace view.
|
|
680
|
+
|
|
681
|
+
---
|
|
682
|
+
|
|
683
|
+
## Troubleshooting
|
|
684
|
+
|
|
685
|
+
| Issue | Cause | Solution |
|
|
686
|
+
| --------------------------------------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
687
|
+
| Events not appearing | DSN not set or `debug: false` hiding errors | Set `debug: true` temporarily in init options; verify `SENTRY_DSN` secret is set with `wrangler secret list` |
|
|
688
|
+
| `AsyncLocalStorage is not defined` | Missing compatibility flag | Add `nodejs_als` or `nodejs_compat` to `compatibility_flags` in `wrangler.toml` |
|
|
689
|
+
| Stack traces show minified code | Source maps not uploaded | Configure `@sentry/vite-plugin` or run `npx @sentry/wizard -i sourcemaps`; verify `SENTRY_AUTH_TOKEN` in CI |
|
|
690
|
+
| Events lost on short-lived requests | SDK not flushing before worker terminates | Ensure `withSentry` or `sentryPagesPlugin` wraps your handler — they use `ctx.waitUntil()` to flush |
|
|
691
|
+
| Hono errors not captured | Hono app not instrumented | Use `@sentry/hono/cloudflare` — import `sentry` middleware and call `app.use(sentry(app, options))` |
|
|
692
|
+
| Durable Object errors missing | DO class not instrumented | Wrap class with `Sentry.instrumentDurableObjectWithSentry()` (Agents SDK classes: `instrumentAgentWithSentry`, v10.69.0+) — see `./durable-objects.md` |
|
|
693
|
+
| D1 queries not creating spans | Not using the SDK-provided `env`, or accessing DB outside the wrapped handler | Use the `env` passed into your handler — `withSentry` auto-instruments D1 bindings on access. No manual wrapping needed |
|
|
694
|
+
| Spans inside `waitUntil()` missing | Root span already ended before the background task ran | Wrap deferred work in `Sentry.startSpan({ ..., forceTransaction: true }, ...)` — see `./tracing.md` |
|
|
695
|
+
| Traces not linked across RPC / DO calls | RPC trace propagation not enabled | Set `enableRpcTracePropagation: true` on **both** caller and receiver (v10.52.0+) — see `./tracing.md` |
|
|
696
|
+
| Scheduled handler not monitored | `withSentry` not wrapping the handler | Ensure `export default Sentry.withSentry(...)` wraps your entire exported handler object |
|
|
697
|
+
| Release not auto-detected | `CF_VERSION_METADATA` binding not configured | Add `[version_metadata]` with `binding = "CF_VERSION_METADATA"` to `wrangler.toml` |
|
|
698
|
+
| Duplicate events in Workflows | Dedupe integration filtering step failures | SDK automatically disables dedupe for Workflows; verify you use `instrumentWorkflowWithSentry` |
|