@sigil-dev/plugin-sentry 0.9.6 → 0.9.7

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.
Files changed (2) hide show
  1. package/README.md +79 -79
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,80 +1,80 @@
1
- # @sigil-dev/plugin-sentry
2
-
3
- Integrates [Sentry](https://sentry.io) with Grimoire. Captures errors and fatal log entries, optionally captures warnings, and reports worker crashes with worker context attached.
4
-
5
- ## Installation
6
-
7
- ```sh
8
- bun add @sigil-dev/plugin-sentry @sentry/bun
9
- ```
10
-
11
- ## Usage
12
-
13
- ```ts
14
- import { defineConfig } from "@sigil-dev/grimoire";
15
- import { sentryPlugin } from "@sigil-dev/plugin-sentry";
16
-
17
- export default defineConfig({
18
- plugins: [
19
- sentryPlugin({
20
- dsn: process.env.SENTRY_DSN!,
21
- }),
22
- ],
23
- });
24
- ```
25
-
26
- ## Options
27
-
28
- ```ts
29
- interface SentryPluginOptions {
30
- /** Sentry DSN. Required. */
31
- dsn: string;
32
- /** Also capture warn-level log entries as Sentry messages. Default: false. */
33
- captureWarns?: boolean;
34
- /** Return false to suppress a log entry from being sent to Sentry. */
35
- beforeSend?: (entry: LogEntry) => boolean;
36
- /** Additional options passed directly to Sentry.init(). */
37
- sentryOptions?: Record<string, unknown>;
38
- }
39
- ```
40
-
41
- ## What gets captured
42
-
43
- | Event | Sentry level | Notes |
44
- |---|---|---|
45
- | `log.error(...)` | `error` | Captures as exception with scope + worker tags. |
46
- | `log.fatal(...)` | `fatal` | Same as error. |
47
- | `log.warn(...)` | `warning` | Only if `captureWarns: true`. |
48
- | Worker crash | `error` | Captured as message with worker name and mode tags. |
49
-
50
- All captured events include request context (`url`, `method`) set via `Sentry.setContext` on each request.
51
-
52
- ## Filtering events
53
-
54
- Use `beforeSend` to suppress specific entries:
55
-
56
- ```ts
57
- sentryPlugin({
58
- dsn: process.env.SENTRY_DSN!,
59
- beforeSend(entry) {
60
- // don't send expected 404s to Sentry
61
- if (entry.message.includes("Not Found")) return false;
62
- return true;
63
- },
64
- })
65
- ```
66
-
67
- ## Passing additional Sentry options
68
-
69
- Any option accepted by `Sentry.init()` can be passed via `sentryOptions`:
70
-
71
- ```ts
72
- sentryPlugin({
73
- dsn: process.env.SENTRY_DSN!,
74
- sentryOptions: {
75
- environment: process.env.NODE_ENV,
76
- release: process.env.GIT_SHA,
77
- tracesSampleRate: 0.2,
78
- },
79
- })
1
+ # @sigil-dev/plugin-sentry
2
+
3
+ Integrates [Sentry](https://sentry.io) with Grimoire. Captures errors and fatal log entries, optionally captures warnings, and reports worker crashes with worker context attached.
4
+
5
+ ## Installation
6
+
7
+ ```sh
8
+ bun add @sigil-dev/plugin-sentry @sentry/bun
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```ts
14
+ import { defineConfig } from "@sigil-dev/grimoire";
15
+ import { sentryPlugin } from "@sigil-dev/plugin-sentry";
16
+
17
+ export default defineConfig({
18
+ plugins: [
19
+ sentryPlugin({
20
+ dsn: process.env.SENTRY_DSN!,
21
+ }),
22
+ ],
23
+ });
24
+ ```
25
+
26
+ ## Options
27
+
28
+ ```ts
29
+ interface SentryPluginOptions {
30
+ /** Sentry DSN. Required. */
31
+ dsn: string;
32
+ /** Also capture warn-level log entries as Sentry messages. Default: false. */
33
+ captureWarns?: boolean;
34
+ /** Return false to suppress a log entry from being sent to Sentry. */
35
+ beforeSend?: (entry: LogEntry) => boolean;
36
+ /** Additional options passed directly to Sentry.init(). */
37
+ sentryOptions?: Record<string, unknown>;
38
+ }
39
+ ```
40
+
41
+ ## What gets captured
42
+
43
+ | Event | Sentry level | Notes |
44
+ |---|---|---|
45
+ | `log.error(...)` | `error` | Captures as exception with scope + worker tags. |
46
+ | `log.fatal(...)` | `fatal` | Same as error. |
47
+ | `log.warn(...)` | `warning` | Only if `captureWarns: true`. |
48
+ | Worker crash | `error` | Captured as message with worker name and mode tags. |
49
+
50
+ All captured events include request context (`url`, `method`) set via `Sentry.setContext` on each request.
51
+
52
+ ## Filtering events
53
+
54
+ Use `beforeSend` to suppress specific entries:
55
+
56
+ ```ts
57
+ sentryPlugin({
58
+ dsn: process.env.SENTRY_DSN!,
59
+ beforeSend(entry) {
60
+ // don't send expected 404s to Sentry
61
+ if (entry.message.includes("Not Found")) return false;
62
+ return true;
63
+ },
64
+ })
65
+ ```
66
+
67
+ ## Passing additional Sentry options
68
+
69
+ Any option accepted by `Sentry.init()` can be passed via `sentryOptions`:
70
+
71
+ ```ts
72
+ sentryPlugin({
73
+ dsn: process.env.SENTRY_DSN!,
74
+ sentryOptions: {
75
+ environment: process.env.NODE_ENV,
76
+ release: process.env.GIT_SHA,
77
+ tracesSampleRate: 0.2,
78
+ },
79
+ })
80
80
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sigil-dev/plugin-sentry",
3
- "version": "0.9.6",
3
+ "version": "0.9.7",
4
4
  "description": "Sentry error tracking plugin for grimoire",
5
5
  "type": "module",
6
6
  "private": false,
@@ -12,7 +12,7 @@
12
12
  "typecheck": "tsc --noEmit"
13
13
  },
14
14
  "dependencies": {
15
- "@sigil-dev/grimoire": "0.9.6",
15
+ "@sigil-dev/grimoire": "0.9.7",
16
16
  "@sentry/bun": "^8.0.0"
17
17
  },
18
18
  "peerDependencies": {