NOTICE: This package is in alpha state and may be subject to breaking changes.
This SDK does not have docs yet. Stay tuned.
import * as Sentry from '@sentry/effect/server';
import { NodeRuntime } from '@effect/platform-node';
import { Layer } from 'effect';
import { HttpLive } from './Http.js';
const MainLive = HttpLive.pipe(
Layer.provide(
Sentry.effectLayer({
dsn: '__DSN__',
enableLogs: true,
enableMetrics: true,
}),
),
);
MainLive.pipe(Layer.launch, NodeRuntime.runMain);The effectLayer function initializes Sentry and returns an Effect Layer that provides:
- Distributed tracing with automatic HTTP header extraction/injection
- Effect spans traced as Sentry spans
- Effect logs forwarded to Sentry (when
enableLogsis set) - Effect metrics sent to Sentry (when
enableMetricsis set)