Skip to content

Draft PR: Effect Integration for Sentry Node SDK #17432

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Divyanshu7001
Copy link

1. Goal

This PR adds support for tracing Effect computations in the Sentry Node SDK. The goal is to automatically create Sentry spans for Effect operations and capture errors that occur within Effect computations as Sentry exceptions, providing better observability for users of the Effect library.

2. Pathway Taken

  • Added a new integration (effectIntegration) and instrumentation (instrumentEffect) under @sentry/node.
  • Followed the robust test/mocking patterns from other integrations to ensure isolated, reliable tests.
  • Updated the SDK’s auto-integration and preload logic to include Effect.
  • Added the effect package as a dependency and provided type definitions for Effect’s tracer API.
  • Wrote comprehensive unit tests for the integration, covering all tracer hooks and error scenarios.

3. How the integration has happened and where it is included now

  • The integration is implemented in packages/node/src/integrations/tracing/effect/.
  • It is exported from the main SDK entrypoint and included in the auto-performance integrations list.
  • The SDK will now automatically register the Effect tracer if the Effect library is present in the user’s project.

4. How users should integrate Effect into their own project

Basic usage:

const Sentry = require('@sentry/node');

Sentry.init({
  dsn: 'YOUR_DSN',
  integrations: [
    Sentry.effectIntegration(),
    // ...other integrations
  ],
  // ...other options
});
  • Just add Sentry.effectIntegration() to your integrations array.
  • The SDK will automatically patch Effect’s tracer and start capturing spans and errors.
  • No manual instrumentation is required for most use cases.

5. Where am i stuck / need help

  • Some test cases are still flaky or failing due to mocking or module loading order (see attached images).
Screenshot 2025-08-19 054036 Screenshot 2025-08-19 054110 Screenshot 2025-08-19 054126 Screenshot 2025-08-19 054055

6. What is my thinking about these errors?

I think these errors are due to me not being able to setup the test environment properly as in most errors..the problem is just Span processes being undefined.
I would appreciate some pointers of where i am going wrong and how should i setup the test environment properly to test.

@Divyanshu7001 Divyanshu7001 requested a review from a team as a code owner August 19, 2025 00:17
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.

1 participant