Skip to content

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

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

feat(effect): Add @sentry/effect SDK (alpha)#19644
JPeer264 wants to merge 6 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

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 📦

Path Size % Change Change
@sentry/browser 25.64 kB +0.03% +6 B 🔺
@sentry/browser - with treeshaking flags 24.15 kB +0.05% +10 B 🔺
@sentry/browser (incl. Tracing) 42.63 kB +0.02% +7 B 🔺
@sentry/browser (incl. Tracing, Profiling) 47.28 kB +0.02% +5 B 🔺
@sentry/browser (incl. Tracing, Replay) 81.43 kB +0.01% +5 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 71 kB +0.01% +6 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 86.13 kB +0.01% +5 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 98.38 kB +0.01% +6 B 🔺
@sentry/browser (incl. Feedback) 42.45 kB +0.02% +7 B 🔺
@sentry/browser (incl. sendFeedback) 30.32 kB +0.02% +6 B 🔺
@sentry/browser (incl. FeedbackAsync) 35.37 kB +0.02% +5 B 🔺
@sentry/browser (incl. Metrics) 26.93 kB +0.02% +4 B 🔺
@sentry/browser (incl. Logs) 27.08 kB +0.05% +11 B 🔺
@sentry/browser (incl. Metrics & Logs) 27.75 kB +0.03% +6 B 🔺
@sentry/react 27.39 kB +0.02% +5 B 🔺
@sentry/react (incl. Tracing) 44.96 kB +0.02% +7 B 🔺
@sentry/vue 30.09 kB +0.01% +3 B 🔺
@sentry/vue (incl. Tracing) 44.49 kB +0.02% +7 B 🔺
@sentry/svelte 25.67 kB +0.02% +5 B 🔺
CDN Bundle 28.27 kB +0.02% +5 B 🔺
CDN Bundle (incl. Tracing) 43.5 kB +0.01% +4 B 🔺
CDN Bundle (incl. Logs, Metrics) 29.14 kB +0.03% +6 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 44.35 kB +0.02% +5 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 68.2 kB +0.02% +7 B 🔺
CDN Bundle (incl. Tracing, Replay) 80.32 kB +0.01% +4 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 81.22 kB +0.01% +5 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 85.86 kB +0.01% +6 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 86.76 kB +0.01% +7 B 🔺
CDN Bundle - uncompressed 82.61 kB +0.05% +41 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 128.54 kB +0.04% +43 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 85.47 kB +0.05% +41 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 131.41 kB +0.04% +43 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 209.1 kB +0.02% +41 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 245.4 kB +0.02% +43 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 248.25 kB +0.02% +43 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 258.31 kB +0.02% +43 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 261.15 kB +0.02% +43 B 🔺
@sentry/nextjs (client) 47.37 kB +0.02% +6 B 🔺
@sentry/sveltekit (client) 43.08 kB +0.02% +7 B 🔺
@sentry/node-core 52.28 kB +0.03% +15 B 🔺
@sentry/node 174.76 kB +0.01% +7 B 🔺
@sentry/node - without tracing 97.44 kB +0.02% +17 B 🔺
@sentry/aws-serverless 113.24 kB +0.02% +14 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 9,385 - 11,440 -18%
GET With Sentry 1,780 19% 2,002 -11%
GET With Sentry (error only) 6,179 66% 7,614 -19%
POST Baseline 1,213 - 1,186 +2%
POST With Sentry 588 48% 595 -1%
POST With Sentry (error only) 1,040 86% 1,043 -0%
MYSQL Baseline 3,249 - 3,993 -19%
MYSQL With Sentry 466 14% 546 -15%
MYSQL With Sentry (error only) 2,714 84% 3,342 -19%

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 5 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
This adds the functionality to send logs to Sentry by setting
`enableLogs: true` in the `Sentry.effectLayer`
This adds metrics to the `Sentry.effectLayer`. It is enabled when
`enableMetrics: true` is added as option
This PR is now adding a different naming schema for enabling logs and
metrics based on:
https://develop.sentry.dev/sdk/telemetry/metrics/#auto-emitted-metrics

For the logs I also added them, which might not make the most sense, as
`enableLogs` is now `false` by default, which means that there is a
double opt-in needed to make logs work via `Effect.log`.

The naming is TBD, but this is the best I came up with:
`enableEffectLogs` & `enableEffectMetrics`
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