Skip to content

Latest commit

 

History

History
47 lines (34 loc) · 1.52 KB

File metadata and controls

47 lines (34 loc) · 1.52 KB

Official Sentry SDK for Effect.ts (Alpha)

npm version npm dm npm dt

NOTICE: This package is in alpha state and may be subject to breaking changes.

Getting Started

This SDK does not have docs yet. Stay tuned.

Usage

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 enableLogs is set)
  • Effect metrics sent to Sentry (when enableMetrics is set)

Links