@envelop/sentry 4.0.0-alpha-ccec0fc.0 → 4.0.0-alpha-7ed14a0a.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/cjs/index.js +1 -0
- package/esm/index.js +1 -0
- package/package.json +5 -5
- package/typings/index.d.cts +81 -0
package/cjs/index.js
CHANGED
|
@@ -128,6 +128,7 @@ const useSentry = (options = {}) => {
|
|
|
128
128
|
scope.setTransactionName(transactionName);
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
+
Sentry.configureScope(scope => scope.setSpan(rootSpan));
|
|
131
132
|
rootSpan.setData('document', document);
|
|
132
133
|
if (options.configureScope) {
|
|
133
134
|
Sentry.configureScope(scope => options.configureScope(args, scope));
|
package/esm/index.js
CHANGED
|
@@ -123,6 +123,7 @@ export const useSentry = (options = {}) => {
|
|
|
123
123
|
scope.setTransactionName(transactionName);
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
+
Sentry.configureScope(scope => scope.setSpan(rootSpan));
|
|
126
127
|
rootSpan.setData('document', document);
|
|
127
128
|
if (options.configureScope) {
|
|
128
129
|
Sentry.configureScope(scope => options.configureScope(args, scope));
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/sentry",
|
|
3
|
-
"version": "4.0.0-alpha-
|
|
3
|
+
"version": "4.0.0-alpha-7ed14a0a.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@envelop/core": "3.0.0-alpha-
|
|
6
|
+
"@envelop/core": "3.0.0-alpha-7ed14a0a.0",
|
|
7
7
|
"@sentry/node": "^6 || ^7",
|
|
8
|
-
"@graphql-tools/graphql": "0.1.0-alpha-
|
|
8
|
+
"@graphql-tools/graphql": "0.1.0-alpha-25f2d2c4.0"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {},
|
|
11
11
|
"repository": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"exports": {
|
|
26
26
|
".": {
|
|
27
27
|
"require": {
|
|
28
|
-
"types": "./typings/index.d.
|
|
28
|
+
"types": "./typings/index.d.cts",
|
|
29
29
|
"default": "./cjs/index.js"
|
|
30
30
|
},
|
|
31
31
|
"import": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"./*": {
|
|
41
41
|
"require": {
|
|
42
|
-
"types": "./typings/*.d.
|
|
42
|
+
"types": "./typings/*.d.cts",
|
|
43
43
|
"default": "./cjs/*.js"
|
|
44
44
|
},
|
|
45
45
|
"import": {
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Plugin } from '@envelop/core';
|
|
2
|
+
import * as Sentry from '@sentry/node';
|
|
3
|
+
import type { TraceparentData } from '@sentry/types';
|
|
4
|
+
import { ExecutionArgs } from '@graphql-tools/graphql';
|
|
5
|
+
export declare type SentryPluginOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* Starts a new transaction for every GraphQL Operation.
|
|
8
|
+
* When disabled, an already existing Transaction will be used.
|
|
9
|
+
*
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
12
|
+
startTransaction?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Renames Transaction.
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
renameTransaction?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Creates a Span for every resolve function
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
trackResolvers?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Adds result of each resolver and operation to Span's data (available under "result")
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
includeRawResult?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Adds arguments of each resolver to Span's tag called "args"
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
includeResolverArgs?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Adds operation's variables to a Scope (only in case of errors)
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
includeExecuteVariables?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The key of the event id in the error's extension. `null` to disable.
|
|
40
|
+
* @default sentryEventId
|
|
41
|
+
*/
|
|
42
|
+
eventIdKey?: string | null;
|
|
43
|
+
/**
|
|
44
|
+
* Adds custom tags to every Transaction.
|
|
45
|
+
*/
|
|
46
|
+
appendTags?: (args: ExecutionArgs) => Record<string, unknown>;
|
|
47
|
+
/**
|
|
48
|
+
* Callback to set context information onto the scope.
|
|
49
|
+
*/
|
|
50
|
+
configureScope?: (args: ExecutionArgs, scope: Sentry.Scope) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Produces a name of Transaction (only when "renameTransaction" or "startTransaction" are enabled) and description of created Span.
|
|
53
|
+
*
|
|
54
|
+
* @default operation's name or "Anonymous Operation" when missing)
|
|
55
|
+
*/
|
|
56
|
+
transactionName?: (args: ExecutionArgs) => string;
|
|
57
|
+
/**
|
|
58
|
+
* Produces tracing data for Transaction
|
|
59
|
+
*
|
|
60
|
+
* @default is empty
|
|
61
|
+
*/
|
|
62
|
+
traceparentData?: (args: ExecutionArgs) => TraceparentData | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Produces a "op" (operation) of created Span.
|
|
65
|
+
*
|
|
66
|
+
* @default execute
|
|
67
|
+
*/
|
|
68
|
+
operationName?: (args: ExecutionArgs) => string;
|
|
69
|
+
/**
|
|
70
|
+
* Indicates whether or not to skip the entire Sentry flow for given GraphQL operation.
|
|
71
|
+
* By default, no operations are skipped.
|
|
72
|
+
*/
|
|
73
|
+
skip?: (args: ExecutionArgs) => boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Indicates whether or not to skip Sentry exception reporting for a given error.
|
|
76
|
+
* By default, this plugin skips all `EnvelopError` errors and does not report it to Sentry.
|
|
77
|
+
*/
|
|
78
|
+
skipError?: (args: Error) => boolean;
|
|
79
|
+
};
|
|
80
|
+
export declare function defaultSkipError(error: Error): boolean;
|
|
81
|
+
export declare const useSentry: (options?: SentryPluginOptions) => Plugin;
|