@vendure/sentry-plugin 3.5.0-minor-202510201346 → 3.5.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.
|
@@ -6,6 +6,12 @@ import { SentryPluginOptions } from './types';
|
|
|
6
6
|
* support for [tracing](https://docs.sentry.io/product/sentry-basics/concepts/tracing/) as well as
|
|
7
7
|
* enriching your Sentry events with additional context about the request.
|
|
8
8
|
*
|
|
9
|
+
* :::info
|
|
10
|
+
* This documentation applies from v3.5.0 of the plugin, which works differently to previous
|
|
11
|
+
* versions. Documentation for prior versions can
|
|
12
|
+
* be found [here](https://github.com/vendure-ecommerce/vendure/blob/1bb9cf8ca1584bce026ccc82f33f866b766ef47d/packages/sentry-plugin/src/sentry-plugin.ts).
|
|
13
|
+
* :::
|
|
14
|
+
*
|
|
9
15
|
* ## Pre-requisites
|
|
10
16
|
*
|
|
11
17
|
* This plugin depends on access to Sentry, which can be self-hosted or used as a cloud service.
|
|
@@ -22,12 +28,25 @@ import { SentryPluginOptions } from './types';
|
|
|
22
28
|
* npm install --save \@vendure/sentry-plugin
|
|
23
29
|
* ```
|
|
24
30
|
*
|
|
31
|
+
* ## Environment Variables
|
|
32
|
+
*
|
|
33
|
+
* The following environment variables are used to control how the Sentry
|
|
34
|
+
* integration behaves:
|
|
35
|
+
*
|
|
36
|
+
* - `SENTRY_DSN`: (required) Sentry Data Source Name
|
|
37
|
+
* - `SENTRY_TRACES_SAMPLE_RATE`: Number between 0 and 1
|
|
38
|
+
* - `SENTRY_PROFILES_SAMPLE_RATE`: Number between 0 and 1
|
|
39
|
+
* - `SENTRY_ENABLE_LOGS`: Boolean. Captures calls to the console API as logs in Sentry. Default `false`
|
|
40
|
+
* - `SENTRY_CAPTURE_LOG_LEVELS`: 'debug' | 'info' | 'warn' | 'error' | 'log' | 'assert' | 'trace'
|
|
41
|
+
*
|
|
25
42
|
* ## Configuration
|
|
26
43
|
*
|
|
27
44
|
* Setting up the Sentry plugin requires two steps:
|
|
28
45
|
*
|
|
29
46
|
* ### Step 1: Preload the Sentry instrument file
|
|
30
47
|
*
|
|
48
|
+
* Make sure the `SENTRY_DSN` environment variable is defined.
|
|
49
|
+
*
|
|
31
50
|
* The Sentry SDK must be initialized before your application starts. This is done by preloading
|
|
32
51
|
* the instrument file when starting your Vendure server:
|
|
33
52
|
*
|
|
@@ -65,7 +84,7 @@ import { SentryPluginOptions } from './types';
|
|
|
65
84
|
*
|
|
66
85
|
* This plugin includes built-in support for [tracing](https://docs.sentry.io/product/sentry-basics/concepts/tracing/), which allows you to see the performance of your.
|
|
67
86
|
* To enable tracing, preload the instrument file as described in [Step 1](#step-1-preload-the-sentry-instrument-file).
|
|
68
|
-
* This
|
|
87
|
+
* This ensures that the Sentry SDK is initialized before any other code is executed.
|
|
69
88
|
*
|
|
70
89
|
* You can also set the `tracesSampleRate` and `profilesSampleRate` options to control the sample rate for
|
|
71
90
|
* tracing and profiling, with the following environment variables:
|
|
@@ -111,5 +130,5 @@ import { SentryPluginOptions } from './types';
|
|
|
111
130
|
*/
|
|
112
131
|
export declare class SentryPlugin {
|
|
113
132
|
static options: SentryPluginOptions;
|
|
114
|
-
static init(options
|
|
133
|
+
static init(options?: SentryPluginOptions): typeof SentryPlugin;
|
|
115
134
|
}
|
|
@@ -26,6 +26,12 @@ const SentryOptionsProvider = {
|
|
|
26
26
|
* support for [tracing](https://docs.sentry.io/product/sentry-basics/concepts/tracing/) as well as
|
|
27
27
|
* enriching your Sentry events with additional context about the request.
|
|
28
28
|
*
|
|
29
|
+
* :::info
|
|
30
|
+
* This documentation applies from v3.5.0 of the plugin, which works differently to previous
|
|
31
|
+
* versions. Documentation for prior versions can
|
|
32
|
+
* be found [here](https://github.com/vendure-ecommerce/vendure/blob/1bb9cf8ca1584bce026ccc82f33f866b766ef47d/packages/sentry-plugin/src/sentry-plugin.ts).
|
|
33
|
+
* :::
|
|
34
|
+
*
|
|
29
35
|
* ## Pre-requisites
|
|
30
36
|
*
|
|
31
37
|
* This plugin depends on access to Sentry, which can be self-hosted or used as a cloud service.
|
|
@@ -42,12 +48,25 @@ const SentryOptionsProvider = {
|
|
|
42
48
|
* npm install --save \@vendure/sentry-plugin
|
|
43
49
|
* ```
|
|
44
50
|
*
|
|
51
|
+
* ## Environment Variables
|
|
52
|
+
*
|
|
53
|
+
* The following environment variables are used to control how the Sentry
|
|
54
|
+
* integration behaves:
|
|
55
|
+
*
|
|
56
|
+
* - `SENTRY_DSN`: (required) Sentry Data Source Name
|
|
57
|
+
* - `SENTRY_TRACES_SAMPLE_RATE`: Number between 0 and 1
|
|
58
|
+
* - `SENTRY_PROFILES_SAMPLE_RATE`: Number between 0 and 1
|
|
59
|
+
* - `SENTRY_ENABLE_LOGS`: Boolean. Captures calls to the console API as logs in Sentry. Default `false`
|
|
60
|
+
* - `SENTRY_CAPTURE_LOG_LEVELS`: 'debug' | 'info' | 'warn' | 'error' | 'log' | 'assert' | 'trace'
|
|
61
|
+
*
|
|
45
62
|
* ## Configuration
|
|
46
63
|
*
|
|
47
64
|
* Setting up the Sentry plugin requires two steps:
|
|
48
65
|
*
|
|
49
66
|
* ### Step 1: Preload the Sentry instrument file
|
|
50
67
|
*
|
|
68
|
+
* Make sure the `SENTRY_DSN` environment variable is defined.
|
|
69
|
+
*
|
|
51
70
|
* The Sentry SDK must be initialized before your application starts. This is done by preloading
|
|
52
71
|
* the instrument file when starting your Vendure server:
|
|
53
72
|
*
|
|
@@ -85,7 +104,7 @@ const SentryOptionsProvider = {
|
|
|
85
104
|
*
|
|
86
105
|
* This plugin includes built-in support for [tracing](https://docs.sentry.io/product/sentry-basics/concepts/tracing/), which allows you to see the performance of your.
|
|
87
106
|
* To enable tracing, preload the instrument file as described in [Step 1](#step-1-preload-the-sentry-instrument-file).
|
|
88
|
-
* This
|
|
107
|
+
* This ensures that the Sentry SDK is initialized before any other code is executed.
|
|
89
108
|
*
|
|
90
109
|
* You can also set the `tracesSampleRate` and `profilesSampleRate` options to control the sample rate for
|
|
91
110
|
* tracing and profiling, with the following environment variables:
|
|
@@ -131,7 +150,7 @@ const SentryOptionsProvider = {
|
|
|
131
150
|
*/
|
|
132
151
|
let SentryPlugin = class SentryPlugin {
|
|
133
152
|
static init(options) {
|
|
134
|
-
this.options = options;
|
|
153
|
+
this.options = options !== null && options !== void 0 ? options : {};
|
|
135
154
|
return this;
|
|
136
155
|
}
|
|
137
156
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sentry-plugin.js","sourceRoot":"","sources":["../../src/sentry-plugin.ts"],"names":[],"mappings":";;;;;;;;;AAAA,gDAAoD;AACpD,wCAAkE;AAElE,mEAAoE;AACpE,yDAAyD;AACzD,iEAA4D;AAC5D,2CAAoD;AACpD,mFAA6E;AAC7E,qDAAiD;AAGjD,MAAM,qBAAqB,GAAG;IAC1B,OAAO,EAAE,iCAAqB;IAC9B,UAAU,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO;CACzC,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"sentry-plugin.js","sourceRoot":"","sources":["../../src/sentry-plugin.ts"],"names":[],"mappings":";;;;;;;;;AAAA,gDAAoD;AACpD,wCAAkE;AAElE,mEAAoE;AACpE,yDAAyD;AACzD,iEAA4D;AAC5D,2CAAoD;AACpD,mFAA6E;AAC7E,qDAAiD;AAGjD,MAAM,qBAAqB,GAAG;IAC1B,OAAO,EAAE,iCAAqB;IAC9B,UAAU,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO;CACzC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgIG;AAgBI,IAAM,YAAY,GAAlB,MAAM,YAAY;IAGrB,MAAM,CAAC,IAAI,CAAC,OAA6B;QACrC,IAAI,CAAC,OAAO,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IAChB,CAAC;;AANQ,oCAAY;AACd,oBAAO,GAAwB,EAAS,AAAjC,CAAkC;uBADvC,YAAY;IAfxB,IAAA,oBAAa,EAAC;QACX,OAAO,EAAE,CAAC,yBAAkB,CAAC;QAC7B,SAAS,EAAE,CAAC,qBAAqB,EAAE,8BAAa,EAAE,qCAAgB,CAAC;QACnE,aAAa,EAAE,MAAM,CAAC,EAAE;YACpB,MAAM,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,0DAA0B,EAAE,CAAC,CAAC;YAC1E,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAY,CAAC,OAAO,EAAE,CAAC,CAAC;YAC5C,OAAO,MAAM,CAAC;QAClB,CAAC;QACD,kBAAkB,EAAE;YAChB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC,CAAC,kCAAiB,CAAC,CAAC,CAAC,SAAS,CAAC;YAC7F,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,6CAAuB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SACpG;QACD,OAAO,EAAE,CAAC,8BAAa,CAAC;QACxB,aAAa,EAAE,QAAQ;KAC1B,CAAC;GACW,YAAY,CAOxB"}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -8,6 +8,10 @@ export interface SentryPluginOptions {
|
|
|
8
8
|
/**
|
|
9
9
|
* @description
|
|
10
10
|
* Whether to include the error test mutation in the admin API.
|
|
11
|
+
* When enabled, a `createTestError` mutation becomes available in
|
|
12
|
+
* the Admin API, which can be used to create different types of error
|
|
13
|
+
* to check that the integration is working correctly.
|
|
14
|
+
*
|
|
11
15
|
* @default false
|
|
12
16
|
*/
|
|
13
17
|
includeErrorTestMutation?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vendure/sentry-plugin",
|
|
3
|
-
"version": "3.5.0
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"license": "GPL-3.0-or-later",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@vendure/common": "
|
|
36
|
-
"@vendure/core": "
|
|
35
|
+
"@vendure/common": "3.5.0",
|
|
36
|
+
"@vendure/core": "3.5.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@sentry/nestjs": "^10.2.0",
|
|
40
40
|
"@sentry/profiling-node": "^10.2.0"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "534e6003534f74761e82de1b8c6061cba89945d1"
|
|
43
43
|
}
|