Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 8 additions & 97 deletions packages/effect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,105 +4,16 @@
[![npm dm](https://img.shields.io/npm/dm/@sentry/effect.svg)](https://www.npmjs.com/package/@sentry/effect)
[![npm dt](https://img.shields.io/npm/dt/@sentry/effect.svg)](https://www.npmjs.com/package/@sentry/effect)

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

`@sentry/effect` supports both Effect v3 and Effect v4 (beta). The integration
auto-detects the installed Effect version at runtime, but the layer composition
APIs differ between the two major versions, so the setup code is slightly
different.

## Getting Started

This SDK does not have docs yet. Stay tuned.

## Usage with Effect v3

```typescript
import * as Sentry from '@sentry/effect/server';
import { NodeRuntime } from '@effect/platform-node';
import { Layer, Logger } from 'effect';
import { HttpLive } from './Http.js';

const SentryLive = Layer.mergeAll(
Sentry.effectLayer({
dsn: '__DSN__',
tracesSampleRate: 1.0,
}),
Layer.setTracer(Sentry.SentryEffectTracer),
Logger.replace(Logger.defaultLogger, Sentry.SentryEffectLogger),
Sentry.SentryEffectMetricsLayer,
);

const MainLive = HttpLive.pipe(Layer.provide(SentryLive));
MainLive.pipe(Layer.launch, NodeRuntime.runMain);
```

## Usage with Effect v4

Effect v4 reorganized the `Tracer` and `Logger` layer APIs, so the wiring looks
slightly different. The `effectLayer`, `SentryEffectTracer`,
`SentryEffectLogger`, and `SentryEffectMetricsLayer` exports themselves are the
same.
The official Sentry SDK for monitoring Effect applications.

```typescript
import * as Sentry from '@sentry/effect/server';
import { NodeHttpServer, NodeRuntime } from '@effect/platform-node';
import * as Layer from 'effect/Layer';
import * as Logger from 'effect/Logger';
import * as Tracer from 'effect/Tracer';
import { HttpRouter } from 'effect/unstable/http';
import { createServer } from 'http';
import { Routes } from './Routes.js';

const SentryLive = Layer.mergeAll(
Sentry.effectLayer({
dsn: '__DSN__',
tracesSampleRate: 1.0,
}),
Layer.succeed(Tracer.Tracer, Sentry.SentryEffectTracer),
Logger.layer([Sentry.SentryEffectLogger]),
Sentry.SentryEffectMetricsLayer,
);

const HttpLive = HttpRouter.serve(Routes).pipe(
Layer.provide(NodeHttpServer.layer(() => createServer(), { port: 3030 })),
Layer.provide(SentryLive),
);

NodeRuntime.runMain(Layer.launch(HttpLive));
```

### Error reporting

On Effect v4, `Sentry.effectLayer` registers a Sentry `ErrorReporter`. Failures
that pass through `Effect.withErrorReporting`, `ErrorReporter.report` or the
built-in HTTP and RPC reporting boundaries are captured automatically. The
`ErrorReporter.ignore`, `ErrorReporter.severity` and `ErrorReporter.attributes`
annotations are respected: ignored errors are skipped, the severity becomes the
event level and the attributes are attached as extra data.

```typescript
import { Data, Effect, ErrorReporter } from 'effect';

class RateLimitError extends Data.TaggedError('RateLimitError')<{ readonly retryAfter: number }> {
readonly [ErrorReporter.severity] = 'Warn' as const;
readonly [ErrorReporter.attributes] = { retryAfter: this.retryAfter };
}

const program = Effect.fail(new RateLimitError({ retryAfter: 60 })).pipe(Effect.withErrorReporting);
```
> NOTICE: This package is in alpha state and may be subject to breaking changes.

Reporters registered with `ErrorReporter.layer` replace the current set, so add
your own reporters with `mergeWithExisting: true` or provide them below the
Sentry layer to keep the Sentry reporter:
## Documentation

```typescript
const SentryLive = Sentry.effectLayer({ dsn: '__DSN__' }).pipe(Layer.provide(ErrorReporter.layer([consoleReporter])));
```
- [Getting started](https://docs.sentry.io/platforms/javascript/guides/effect/)
- [Configuration](https://docs.sentry.io/platforms/javascript/guides/effect/configuration/)

## Links
## Support

- [Official SDK Docs](https://docs.sentry.io/platforms/javascript/guides/effect/)
- [Sentry.io](https://sentry.io/?utm_source=github&utm_medium=npm_effect)
- [Sentry Discord Server](https://discord.gg/Ww9hbqr)
- [Stack Overflow](https://stackoverflow.com/questions/tagged/sentry)
- [Report a bug](https://github.com/getsentry/sentry-javascript/issues/new/choose)
- [Contributing](https://github.com/getsentry/sentry-javascript/blob/develop/CONTRIBUTING.md)
29 changes: 8 additions & 21 deletions packages/elysia/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,22 @@
</a>
</p>

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

# Official Sentry SDK for Elysia

[![npm version](https://img.shields.io/npm/v/@sentry/elysia.svg)](https://www.npmjs.com/package/@sentry/elysia)
[![npm dm](https://img.shields.io/npm/dm/@sentry/elysia.svg)](https://www.npmjs.com/package/@sentry/elysia)
[![npm dt](https://img.shields.io/npm/dt/@sentry/elysia.svg)](https://www.npmjs.com/package/@sentry/elysia)

> **Alpha**: This SDK is in alpha stage and may have breaking changes in future releases.

## Usage
The official Sentry SDK for monitoring Elysia applications.

```javascript
import * as Sentry from '@sentry/elysia';
import { Elysia } from 'elysia';

Sentry.init({
dsn: '__DSN__',
tracesSampleRate: 1.0,
});
> NOTICE: This package is in alpha state and may be subject to breaking changes.

const app = Sentry.withElysia(new Elysia())
.get('/', () => 'Hello World')
.listen(3000);
```
## Documentation

## Links
- [Getting started](https://docs.sentry.io/platforms/javascript/guides/elysia/)
- [Configuration](https://docs.sentry.io/platforms/javascript/guides/elysia/configuration/)

<!-- - [Official SDK Docs](https://docs.sentry.io/platforms/javascript/guides/elysia/) -->
## Support

- [Sentry.io](https://sentry.io/?utm_source=github&utm_medium=npm_elysia)
- [Sentry Discord Server](https://discord.gg/Ww9hbqr)
- [Report a bug](https://github.com/getsentry/sentry-javascript/issues/new/choose)
- [Contributing](https://github.com/getsentry/sentry-javascript/blob/develop/CONTRIBUTING.md)
12 changes: 8 additions & 4 deletions packages/wasm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@
[![npm dm](https://img.shields.io/npm/dm/@sentry/wasm.svg)](https://www.npmjs.com/package/@sentry/wasm)
[![npm dt](https://img.shields.io/npm/dt/@sentry/wasm.svg)](https://www.npmjs.com/package/@sentry/wasm)

## Links
WebAssembly stack-trace support for the Sentry JavaScript SDK.

- [Official SDK Docs](https://docs.sentry.io/quickstart/)
## Documentation

## General
- [Getting started](https://docs.sentry.io/platforms/javascript/guides/wasm/)
- [Configuration](https://docs.sentry.io/platforms/javascript/guides/wasm/configuration/)

This package provides support for WebAssembly in stack traces.
## Support

- [Report a bug](https://github.com/getsentry/sentry-javascript/issues/new/choose)
- [Contributing](https://github.com/getsentry/sentry-javascript/blob/develop/CONTRIBUTING.md)
Loading