-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
options.ts
147 lines (125 loc) · 4.7 KB
/
options.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import { Breadcrumb, BreadcrumbHint } from './breadcrumb';
import { Event, EventHint } from './event';
import { Integration } from './integration';
import { LogLevel } from './loglevel';
import { Transport, TransportClass, TransportOptions } from './transport';
/** Base configuration options for every SDK. */
export interface Options {
/**
* Enable debug functionality in the SDK itself
*/
debug?: boolean;
/**
* Specifies whether this SDK should activate and send events to Sentry.
* Disabling the SDK reduces all overhead from instrumentation, collecting
* breadcrumbs and capturing events. Defaults to true.
*/
enabled?: boolean;
/**
* The Dsn used to connect to Sentry and identify the project. If omitted, the
* SDK will not send any data to Sentry.
*/
dsn?: string;
/**
* If this is set to false, default integrations will not be added, otherwise this will internally be set to the
* recommended default integrations.
*/
defaultIntegrations?: false | Integration[];
/**
* List of integrations that should be installed after SDK was initialized.
* Accepts either a list of integrations or a function that receives
* default integrations and returns a new, updated list.
*/
integrations?: Integration[] | ((integrations: Integration[]) => Integration[]);
/**
* A pattern for error messages which should not be sent to Sentry.
* By default, all errors will be sent.
*/
ignoreErrors?: Array<string | RegExp>;
/**
* Transport object that should be used to send events to Sentry
*/
transport?: TransportClass<Transport>;
/**
* Options for the default transport that the SDK uses.
*/
transportOptions?: TransportOptions;
/**
* The release identifier used when uploading respective source maps. Specify
* this value to allow Sentry to resolve the correct source maps when
* processing events.
*/
release?: string;
/** The current environment of your application (e.g. "production"). */
environment?: string;
/** Sets the distribution for all events */
dist?: string;
/**
* The maximum number of breadcrumbs sent with events. Defaults to 30.
* Values over 100 will be ignored and 100 used instead.
*/
maxBreadcrumbs?: number;
/** Console logging verbosity for the SDK Client. */
logLevel?: LogLevel;
/** A global sample rate to apply to all events (0 - 1). */
sampleRate?: number;
/**
* Sample rate to determine trace sampling.
*
* 0.0 = 0% chance of instrumenting
* 1.0 = 100% chance of instrumenting
*
* Default: 0.0
*/
tracesSampleRate?: number;
/** Attaches stacktraces to pure capture message / log integrations */
attachStacktrace?: boolean;
/** Maxium number of chars a single value can have before it will be truncated. */
maxValueLength?: number;
/**
* Maximum number of levels that normalization algorithm will traverse in objects and arrays.
* Used when normalizing an event before sending, on all of the listed attributes:
* - `breadcrumbs.data`
* - `user`
* - `contexts`
* - `extra`
* Defaults to `3`. Set to `0` to disable.
*/
normalizeDepth?: number;
/**
* A callback invoked during event submission, allowing to optionally modify
* the event before it is sent to Sentry.
*
* Note that you must return a valid event from this callback. If you do not
* wish to modify the event, simply return it at the end.
* Returning null will case the event to be dropped.
*
* @param event The error or message event generated by the SDK.
* @param hint May contain additional information about the original exception.
* @returns A new event that will be sent | null.
*/
beforeSend?(event: Event, hint?: EventHint): PromiseLike<Event | null> | Event | null;
/**
* A callback invoked when adding a breadcrumb, allowing to optionally modify
* it before adding it to future events.
*
* Note that you must return a valid breadcrumb from this callback. If you do
* not wish to modify the breadcrumb, simply return it at the end.
* Returning null will case the breadcrumb to be dropped.
*
* @param breadcrumb The breadcrumb as created by the SDK.
* @returns The breadcrumb that will be added | null.
*/
beforeBreadcrumb?(breadcrumb: Breadcrumb, hint?: BreadcrumbHint): Breadcrumb | null;
/**
* Controls how many milliseconds to wait before shutting down. The default is
* SDK-specific but typically around 2 seconds. Setting this too low can cause
* problems for sending events from command line applications. Setting it too
* high can cause the application to block for users with network connectivity
* problems.
*/
shutdownTimeout?: number;
_experiments?: {
[key: string]: any;
};
}