UNPKG

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