1 | import { Breadcrumb, BreadcrumbHint } from './breadcrumb';
|
2 | import { Event, EventHint } from './event';
|
3 | import { Integration } from './integration';
|
4 | import { CaptureContext } from './scope';
|
5 | import { SdkMetadata } from './sdkmetadata';
|
6 | import { SamplingContext } from './transaction';
|
7 | import { Transport, TransportClass, TransportOptions } from './transport';
|
8 |
|
9 | export interface Options {
|
10 | |
11 |
|
12 |
|
13 | debug?: boolean;
|
14 | |
15 |
|
16 |
|
17 |
|
18 | enabled?: boolean;
|
19 | |
20 |
|
21 |
|
22 |
|
23 | dsn?: string;
|
24 | |
25 |
|
26 |
|
27 |
|
28 |
|
29 | defaultIntegrations?: false | Integration[];
|
30 | |
31 |
|
32 |
|
33 |
|
34 |
|
35 | integrations?: Integration[] | ((integrations: Integration[]) => Integration[]);
|
36 | /**
|
37 | * A pattern for error messages which should not be sent to Sentry.
|
38 | * By default, all errors will be sent.
|
39 | */
|
40 | ignoreErrors?: Array<string | RegExp>;
|
41 | /**
|
42 | * Transport object that should be used to send events to Sentry
|
43 | */
|
44 | transport?: TransportClass<Transport>;
|
45 | /**
|
46 | * Options for the default transport that the SDK uses.
|
47 | */
|
48 | transportOptions?: TransportOptions;
|
49 | /**
|
50 | * A URL to an envelope tunnel endpoint. An envelope tunnel is an HTTP endpoint
|
51 | * that accepts Sentry envelopes for forwarding. This can be used to force data
|
52 | * through a custom server independent of the type of data.
|
53 | */
|
54 | tunnel?: string;
|
55 | /**
|
56 | * The release identifier used when uploading respective source maps. Specify
|
57 | * this value to allow Sentry to resolve the correct source maps when
|
58 | * processing events.
|
59 | */
|
60 | release?: string;
|
61 | /** The current environment of your application (e.g. "production"). */
|
62 | environment?: string;
|
63 | /** Sets the distribution for all events */
|
64 | dist?: string;
|
65 | /**
|
66 | * The maximum number of breadcrumbs sent with events. Defaults to 100.
|
67 | * Values over 100 will be ignored and 100 used instead.
|
68 | */
|
69 | maxBreadcrumbs?: number;
|
70 | /** A global sample rate to apply to all events (0 - 1). */
|
71 | sampleRate?: number;
|
72 | /** Attaches stacktraces to pure capture message / log integrations */
|
73 | attachStacktrace?: boolean;
|
74 | /** Maximum number of chars a single value can have before it will be truncated. */
|
75 | maxValueLength?: number;
|
76 | /**
|
77 | * Maximum number of levels that normalization algorithm will traverse in objects and arrays.
|
78 | * Used when normalizing an event before sending, on all of the listed attributes:
|
79 | * - `breadcrumbs.data`
|
80 | * - `user`
|
81 | * - `contexts`
|
82 | * - `extra`
|
83 | * Defaults to `3`. Set to `0` to disable.
|
84 | */
|
85 | normalizeDepth?: number;
|
86 | /**
|
87 | * Maximum number of properties or elements that the normalization algorithm will output in any single array or object included in the normalized event.
|
88 | * Used when normalizing an event before sending, on all of the listed attributes:
|
89 | * - `breadcrumbs.data`
|
90 | * - `user`
|
91 | * - `contexts`
|
92 | * - `extra`
|
93 | * Defaults to `1000`
|
94 | */
|
95 | normalizeMaxBreadth?: number;
|
96 | /**
|
97 | * Controls how many milliseconds to wait before shutting down. The default is
|
98 | * SDK-specific but typically around 2 seconds. Setting this too low can cause
|
99 | * problems for sending events from command line applications. Setting it too
|
100 | * high can cause the application to block for users with network connectivity
|
101 | * problems.
|
102 | */
|
103 | shutdownTimeout?: number;
|
104 | /**
|
105 | * Sample rate to determine trace sampling.
|
106 | *
|
107 | * 0.0 = 0% chance of a given trace being sent (send no traces) 1.0 = 100% chance of a given trace being sent (send
|
108 | * all traces)
|
109 | *
|
110 | * Tracing is enabled if either this or `tracesSampler` is defined. If both are defined, `tracesSampleRate` is
|
111 | * ignored.
|
112 | */
|
113 | tracesSampleRate?: number;
|
114 | /**
|
115 | * A flag enabling Sessions Tracking feature.
|
116 | * By default, Sessions Tracking is enabled.
|
117 | */
|
118 | autoSessionTracking?: boolean;
|
119 | /**
|
120 | * Send SDK Client Reports.
|
121 | * By default, Client Reports are enabled.
|
122 | */
|
123 | sendClientReports?: boolean;
|
124 | /**
|
125 | * Initial data to populate scope.
|
126 | */
|
127 | initialScope?: CaptureContext;
|
128 | /**
|
129 | * Set of metadata about the SDK that can be internally used to enhance envelopes and events,
|
130 | * and provide additional data about every request.
|
131 | * */
|
132 | _metadata?: SdkMetadata;
|
133 | /**
|
134 | * Options which are in beta, or otherwise not guaranteed to be stable.
|
135 | */
|
136 | _experiments?: {
|
137 | [key: string]: any;
|
138 | };
|
139 | /**
|
140 | * Function to compute tracing sample rate dynamically and filter unwanted traces.
|
141 | *
|
142 | * Tracing is enabled if either this or `tracesSampleRate` is defined. If both are defined, `tracesSampleRate` is
|
143 | * ignored.
|
144 | *
|
145 | * Will automatically be passed a context object of default and optional custom data. See
|
146 | * {@link Transaction.samplingContext} and {@link Hub.startTransaction}.
|
147 | *
|
148 | * @returns A sample rate between 0 and 1 (0 drops the trace, 1 guarantees it will be sent). Returning `true` is
|
149 | * equivalent to returning 1 and returning `false` is equivalent to returning 0.
|
150 | */
|
151 | tracesSampler?: (samplingContext: SamplingContext) => number | boolean;
|
152 | |
153 |
|
154 |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 |
|
163 |
|
164 | beforeSend?: (event: Event, hint?: EventHint) => PromiseLike<Event | null> | Event | null;
|
165 | |
166 |
|
167 |
|
168 |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 |
|
174 |
|
175 |
|
176 | beforeBreadcrumb?: (breadcrumb: Breadcrumb, hint?: BreadcrumbHint) => Breadcrumb | null;
|
177 | }
|
178 |
|
\ | No newline at end of file |