UNPKG

2.88 kBTypeScriptView Raw
1import type { ClientOptions, Options, SamplingContext, TracePropagationTargets } from '@sentry/types';
2import type { NodeTransportOptions } from './transports';
3export interface BaseNodeOptions {
4 /**
5 * Sets profiling sample rate when @sentry/profiling-node is installed
6 */
7 profilesSampleRate?: number;
8 /**
9 * Function to compute profiling sample rate dynamically and filter unwanted profiles.
10 *
11 * Profiling is enabled if either this or `profilesSampleRate` is defined. If both are defined, `profilesSampleRate` is
12 * ignored.
13 *
14 * Will automatically be passed a context object of default and optional custom data. See
15 * {@link Transaction.samplingContext} and {@link Hub.startTransaction}.
16 *
17 * @returns A sample rate between 0 and 1 (0 drops the profile, 1 guarantees it will be sent). Returning `true` is
18 * equivalent to returning 1 and returning `false` is equivalent to returning 0.
19 */
20 profilesSampler?: (samplingContext: SamplingContext) => number | boolean;
21 /** Sets an optional server name (device name) */
22 serverName?: string;
23 /**
24 * Include local variables with stack traces.
25 *
26 * Requires the `LocalVariables` integration.
27 */
28 includeLocalVariables?: boolean;
29 /**
30 * List of strings/regex controlling to which outgoing requests
31 * the SDK will attach tracing headers.
32 *
33 * By default the SDK will attach those headers to all outgoing
34 * requests. If this option is provided, the SDK will match the
35 * request URL of outgoing requests against the items in this
36 * array, and only attach tracing headers if a match was found.
37 *
38 * @example
39 * ```js
40 * Sentry.init({
41 * tracePropagationTargets: ['api.site.com'],
42 * });
43 * ```
44 */
45 tracePropagationTargets?: TracePropagationTargets;
46 /**
47 * @deprecated Moved to constructor options of the `Http` and `Undici` integration.
48 * @example
49 * ```js
50 * Sentry.init({
51 * integrations: [
52 * new Sentry.Integrations.Http({
53 * tracing: {
54 * shouldCreateSpanForRequest: (url: string) => false,
55 * }
56 * });
57 * ],
58 * });
59 * ```
60 */
61 shouldCreateSpanForRequest?(this: void, url: string): boolean;
62 /** Callback that is executed when a fatal global error occurs. */
63 onFatalError?(this: void, error: Error): void;
64}
65/**
66 * Configuration options for the Sentry Node SDK
67 * @see @sentry/types Options for more information.
68 */
69export interface NodeOptions extends Options<NodeTransportOptions>, BaseNodeOptions {
70}
71/**
72 * Configuration options for the Sentry Node SDK Client class
73 * @see NodeClient for more information.
74 */
75export interface NodeClientOptions extends ClientOptions<NodeTransportOptions>, BaseNodeOptions {
76}
77//# sourceMappingURL=types.d.ts.map
\No newline at end of file