Skip to content

feat(effect): Add @sentry/effect SDK (alpha)#19644

Draft
JPeer264 wants to merge 3 commits intodevelopfrom
jp/add-effect-sdk
Draft

feat(effect): Add @sentry/effect SDK (alpha)#19644
JPeer264 wants to merge 3 commits intodevelopfrom
jp/add-effect-sdk

Conversation

@JPeer264
Copy link
Member

@JPeer264 JPeer264 commented Mar 5, 2026

closes #19641
closes JS-1864

This PR collects all Effect SDK integration PRs.

The Effect SDK provides first-class integration with Effect, enabling automatic tracing, logging, and metrics capture for Effect-based applications.

Features

  • Tracer: OpenTelemetry-compatible tracer that creates Sentry spans from Effect spans
  • Logger: Routes Effect logs to Sentry's logging system
  • Metrics: Captures Effect metrics (counters, gauges, histograms) as Sentry metrics
  • Layer: Composable Effect Layer for easy SDK integration
  • Client/Server entry points: Tree-shakeable entry points for browser and Node.js

Checklist of features

All items need to be checked before it goes to develop

  • Add base scaffolding for the Effect SDK
  • Support traces
  • Support logs
  • Support metrics
  • Add unit tests
  • Add Node E2E tests
  • Add browser E2E tests
  • (optional) Add Deno E2E tests

Merge checklist

  • All items from the Checklist of features are checked
  • Create issue for the docs
  • Rebase merge to keep the history

This is one of many PRs to create the effect SDK. Once this has been
merged I will open the draft PR for the effect sdk and create the plan
in there.

(the almost final SDK can be viewed here:
https://github.com/getsentry/sentry-javascript/tree/jp/effect-sdk. It
might be that some specifics change, especially when having browser +
server split, and with tracing)

---

This PR focuses on the base skaffolding of `@sentry/effect`. This on its
own is not really doing anything except setting up the skaffold. The
README already reflects the actual usage, while the export doesn't exist
yet, this will come in another PR (also `init` is exposed here, just for
the sake of completeness)

---------

Co-authored-by: Claude <noreply@anthropic.com>
@linear-code
Copy link

linear-code bot commented Mar 5, 2026

@JPeer264 JPeer264 self-assigned this Mar 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 25.63 kB - -
@sentry/browser - with treeshaking flags 24.13 kB - -
@sentry/browser (incl. Tracing) 42.43 kB - -
@sentry/browser (incl. Tracing, Profiling) 47.09 kB - -
@sentry/browser (incl. Tracing, Replay) 81.25 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 70.87 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 85.95 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 98.21 kB - -
@sentry/browser (incl. Feedback) 42.44 kB - -
@sentry/browser (incl. sendFeedback) 30.3 kB - -
@sentry/browser (incl. FeedbackAsync) 35.35 kB - -
@sentry/browser (incl. Metrics) 26.8 kB - -
@sentry/browser (incl. Logs) 26.94 kB - -
@sentry/browser (incl. Metrics & Logs) 27.61 kB - -
@sentry/react 27.38 kB - -
@sentry/react (incl. Tracing) 44.77 kB - -
@sentry/vue 30.08 kB - -
@sentry/vue (incl. Tracing) 44.3 kB - -
@sentry/svelte 25.66 kB - -
CDN Bundle 28.17 kB - -
CDN Bundle (incl. Tracing) 43.26 kB - -
CDN Bundle (incl. Logs, Metrics) 29.01 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 44.1 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 68.09 kB - -
CDN Bundle (incl. Tracing, Replay) 80.14 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 81 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 85.65 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 86.53 kB - -
CDN Bundle - uncompressed 82.35 kB - -
CDN Bundle (incl. Tracing) - uncompressed 128.07 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 85.19 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 130.9 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 208.85 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 244.95 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 247.77 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 257.86 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 260.67 kB - -
@sentry/nextjs (client) 47.18 kB - -
@sentry/sveltekit (client) 42.89 kB - -
@sentry/node-core 52.25 kB +0.02% +8 B 🔺
@sentry/node 174.73 kB +0.02% +20 B 🔺
@sentry/node - without tracing 97.39 kB +0.02% +11 B 🔺
@sentry/aws-serverless 113.2 kB +0.01% +10 B 🔺

View base workflow run

@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 11,142 - 8,720 +28%
GET With Sentry 1,897 17% 1,590 +19%
GET With Sentry (error only) 7,189 65% 5,921 +21%
POST Baseline 1,145 - 1,169 -2%
POST With Sentry 559 49% 557 +0%
POST With Sentry (error only) 1,021 89% 1,031 -1%
MYSQL Baseline 3,881 - 3,222 +20%
MYSQL With Sentry 483 12% 363 +33%
MYSQL With Sentry (error only) 3,104 80% 2,641 +18%

View base workflow run

@JPeer264 JPeer264 changed the title feat(effect): Add base skaffolding for Effect.ts (#19622) feat(effect): Add @sentry/effect SDK Mar 5, 2026
@JPeer264 JPeer264 changed the title feat(effect): Add @sentry/effect SDK feat(effect): Add @sentry/effect SDK (alpha) Mar 5, 2026
JPeer264 added 2 commits March 5, 2026 14:35
…9649)

That adds now the functionality to use the `Sentry.effectLayer`
properly. **But** it doesn't do anything, which means right now, to keep
the PRs small, it returns an empty layer.

Following can be used without any Sentry functionality:

```js
const MainLive = HttpLive.pipe(Layer.provide(Sentry.effectLayer({
  dsn: "",
  tracesSampleRate: 1.0,
  debug: true,
})))

MainLive.pipe(Layer.launch, NodeRuntime.runMain)
```
This adds tracing to the `Sentry.effectLayer`. By setting
`tracesSampleRate: 1.0` in the options tracing is enabled and spans can
be send to Sentry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Effect.ts via its own SDK

1 participant