@sentry/effect 11.0.0-rc.1 → 11.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,105 +4,16 @@
4
4
  [![npm dm](https://img.shields.io/npm/dm/@sentry/effect.svg)](https://www.npmjs.com/package/@sentry/effect)
5
5
  [![npm dt](https://img.shields.io/npm/dt/@sentry/effect.svg)](https://www.npmjs.com/package/@sentry/effect)
6
6
 
7
- > NOTICE: This package is in alpha state and may be subject to breaking changes.
8
-
9
- `@sentry/effect` supports both Effect v3 and Effect v4 (beta). The integration
10
- auto-detects the installed Effect version at runtime, but the layer composition
11
- APIs differ between the two major versions, so the setup code is slightly
12
- different.
13
-
14
- ## Getting Started
15
-
16
- This SDK does not have docs yet. Stay tuned.
17
-
18
- ## Usage with Effect v3
19
-
20
- ```typescript
21
- import * as Sentry from '@sentry/effect/server';
22
- import { NodeRuntime } from '@effect/platform-node';
23
- import { Layer, Logger } from 'effect';
24
- import { HttpLive } from './Http.js';
25
-
26
- const SentryLive = Layer.mergeAll(
27
- Sentry.effectLayer({
28
- dsn: '__DSN__',
29
- tracesSampleRate: 1.0,
30
- }),
31
- Layer.setTracer(Sentry.SentryEffectTracer),
32
- Logger.replace(Logger.defaultLogger, Sentry.SentryEffectLogger),
33
- Sentry.SentryEffectMetricsLayer,
34
- );
35
-
36
- const MainLive = HttpLive.pipe(Layer.provide(SentryLive));
37
- MainLive.pipe(Layer.launch, NodeRuntime.runMain);
38
- ```
39
-
40
- ## Usage with Effect v4
41
-
42
- Effect v4 reorganized the `Tracer` and `Logger` layer APIs, so the wiring looks
43
- slightly different. The `effectLayer`, `SentryEffectTracer`,
44
- `SentryEffectLogger`, and `SentryEffectMetricsLayer` exports themselves are the
45
- same.
7
+ The official Sentry SDK for monitoring Effect applications.
46
8
 
47
- ```typescript
48
- import * as Sentry from '@sentry/effect/server';
49
- import { NodeHttpServer, NodeRuntime } from '@effect/platform-node';
50
- import * as Layer from 'effect/Layer';
51
- import * as Logger from 'effect/Logger';
52
- import * as Tracer from 'effect/Tracer';
53
- import { HttpRouter } from 'effect/unstable/http';
54
- import { createServer } from 'http';
55
- import { Routes } from './Routes.js';
56
-
57
- const SentryLive = Layer.mergeAll(
58
- Sentry.effectLayer({
59
- dsn: '__DSN__',
60
- tracesSampleRate: 1.0,
61
- }),
62
- Layer.succeed(Tracer.Tracer, Sentry.SentryEffectTracer),
63
- Logger.layer([Sentry.SentryEffectLogger]),
64
- Sentry.SentryEffectMetricsLayer,
65
- );
66
-
67
- const HttpLive = HttpRouter.serve(Routes).pipe(
68
- Layer.provide(NodeHttpServer.layer(() => createServer(), { port: 3030 })),
69
- Layer.provide(SentryLive),
70
- );
71
-
72
- NodeRuntime.runMain(Layer.launch(HttpLive));
73
- ```
74
-
75
- ### Error reporting
76
-
77
- On Effect v4, `Sentry.effectLayer` registers a Sentry `ErrorReporter`. Failures
78
- that pass through `Effect.withErrorReporting`, `ErrorReporter.report` or the
79
- built-in HTTP and RPC reporting boundaries are captured automatically. The
80
- `ErrorReporter.ignore`, `ErrorReporter.severity` and `ErrorReporter.attributes`
81
- annotations are respected: ignored errors are skipped, the severity becomes the
82
- event level and the attributes are attached as extra data.
83
-
84
- ```typescript
85
- import { Data, Effect, ErrorReporter } from 'effect';
86
-
87
- class RateLimitError extends Data.TaggedError('RateLimitError')<{ readonly retryAfter: number }> {
88
- readonly [ErrorReporter.severity] = 'Warn' as const;
89
- readonly [ErrorReporter.attributes] = { retryAfter: this.retryAfter };
90
- }
91
-
92
- const program = Effect.fail(new RateLimitError({ retryAfter: 60 })).pipe(Effect.withErrorReporting);
93
- ```
9
+ > NOTICE: This package is in alpha state and may be subject to breaking changes.
94
10
 
95
- Reporters registered with `ErrorReporter.layer` replace the current set, so add
96
- your own reporters with `mergeWithExisting: true` or provide them below the
97
- Sentry layer to keep the Sentry reporter:
11
+ ## Documentation
98
12
 
99
- ```typescript
100
- const SentryLive = Sentry.effectLayer({ dsn: '__DSN__' }).pipe(Layer.provide(ErrorReporter.layer([consoleReporter])));
101
- ```
13
+ - [Getting started](https://docs.sentry.io/platforms/javascript/guides/effect/)
14
+ - [Configuration](https://docs.sentry.io/platforms/javascript/guides/effect/configuration/)
102
15
 
103
- ## Links
16
+ ## Support
104
17
 
105
- - [Official SDK Docs](https://docs.sentry.io/platforms/javascript/guides/effect/)
106
- - [Sentry.io](https://sentry.io/?utm_source=github&utm_medium=npm_effect)
107
- - [Sentry Discord Server](https://discord.gg/Ww9hbqr)
108
- - [Stack Overflow](https://stackoverflow.com/questions/tagged/sentry)
18
+ - [Report a bug](https://github.com/getsentry/sentry-javascript/issues/new/choose)
19
+ - [Contributing](https://github.com/getsentry/sentry-javascript/blob/develop/CONTRIBUTING.md)
@@ -1 +1 @@
1
- {"type":"module","version":"11.0.0-rc.1","sideEffects":false}
1
+ {"type":"module","version":"11.1.0","sideEffects":false}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/effect",
3
- "version": "11.0.0-rc.1",
3
+ "version": "11.1.0",
4
4
  "description": "Official Sentry SDK for Effect",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/effect",
@@ -44,10 +44,10 @@
44
44
  "access": "public"
45
45
  },
46
46
  "dependencies": {
47
- "@sentry/browser": "11.0.0-rc.1",
48
- "@sentry/conventions": "^0.23.0",
49
- "@sentry/core": "11.0.0-rc.1",
50
- "@sentry/node": "11.0.0-rc.1"
47
+ "@sentry/browser": "11.1.0",
48
+ "@sentry/conventions": "^0.24.0",
49
+ "@sentry/core": "11.1.0",
50
+ "@sentry/node": "11.1.0"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "effect": "^3.0.0 || ^4.0.0-beta.50"