Skip to content

Commit f1b88cd

Browse files
committed
feat(core): Add more types to BaseWinterTCOptions
1 parent 88f90dc commit f1b88cd

File tree

3 files changed

+56
-108
lines changed

3 files changed

+56
-108
lines changed

packages/core/src/types-hoist/options.ts

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { Instrumentation } from '@opentelemetry/instrumentation';
2+
import type { SpanProcessor } from '@opentelemetry/sdk-trace-base';
13
import type { CaptureContext } from '../scope';
24
import type { Breadcrumb, BreadcrumbHint } from './breadcrumb';
35
import type { ErrorEvent, EventHint, TransactionEvent } from './event';
@@ -66,6 +68,58 @@ export interface BaseWinterTCOptions {
6668
*/
6769
skipOpenTelemetrySetup?: boolean;
6870

71+
/**
72+
* If set to `false`, the SDK will not automatically detect the `serverName`.
73+
*
74+
* This is useful if you are using the SDK in a CLI app or Electron where the
75+
* hostname might be considered PII.
76+
*
77+
* @default true
78+
*/
79+
includeServerName?: boolean;
80+
81+
/**
82+
* By default, the SDK will try to identify problems with your instrumentation setup and warn you about it.
83+
* If you want to disable these warnings, set this to `true`.
84+
*/
85+
disableInstrumentationWarnings?: boolean;
86+
87+
/**
88+
* Controls how many milliseconds to wait before shutting down. The default is 2 seconds. Setting this too low can cause
89+
* problems for sending events from command line applications. Setting it too
90+
* high can cause the application to block for users with network connectivity
91+
* problems.
92+
*/
93+
shutdownTimeout?: number;
94+
95+
/**
96+
* Configures in which interval client reports will be flushed. Defaults to `60_000` (milliseconds).
97+
*/
98+
clientReportFlushInterval?: number;
99+
100+
/**
101+
* Provide an array of OpenTelemetry Instrumentations that should be registered.
102+
*
103+
* Use this option if you want to register OpenTelemetry instrumentation that the Sentry SDK does not yet have support for.
104+
*/
105+
openTelemetryInstrumentations?: Instrumentation[];
106+
107+
/**
108+
* Provide an array of additional OpenTelemetry SpanProcessors that should be registered.
109+
*/
110+
openTelemetrySpanProcessors?: SpanProcessor[];
111+
112+
/**
113+
* The max. duration in seconds that the SDK will wait for parent spans to be finished before discarding a span.
114+
* The SDK will automatically clean up spans that have no finished parent after this duration.
115+
* This is necessary to prevent memory leaks in case of parent spans that are never finished or otherwise dropped/missing.
116+
* However, if you have very long-running spans in your application, a shorter duration might cause spans to be discarded too early.
117+
* In this case, you can increase this duration to a value that fits your expected data.
118+
*
119+
* Defaults to 300 seconds (5 minutes).
120+
*/
121+
maxSpanWaitDuration?: number;
122+
69123
/**
70124
* Callback that is executed when a fatal global error occurs.
71125
*/

packages/node-core/src/types.ts

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { Span as WriteableSpan } from '@opentelemetry/api';
2-
import type { Instrumentation } from '@opentelemetry/instrumentation';
3-
import type { ReadableSpan, SpanProcessor } from '@opentelemetry/sdk-trace-base';
2+
import type { ReadableSpan } from '@opentelemetry/sdk-trace-base';
43
import type { BaseWinterTCOptions, ClientOptions, Options, SamplingContext, Scope, Span } from '@sentry/core';
54
import type { NodeTransportOptions } from './transports';
65

@@ -47,46 +46,13 @@ export interface BaseNodeOptions extends BaseWinterTCOptions {
4746
*/
4847
profileLifecycle?: 'manual' | 'trace';
4948

50-
/**
51-
* If set to `false`, the SDK will not automatically detect the `serverName`.
52-
*
53-
* This is useful if you are using the SDK in a CLI app or Electron where the
54-
* hostname might be considered PII.
55-
*
56-
* @default true
57-
*/
58-
includeServerName?: boolean;
59-
6049
/**
6150
* Include local variables with stack traces.
6251
*
6352
* Requires the `LocalVariables` integration.
6453
*/
6554
includeLocalVariables?: boolean;
6655

67-
/**
68-
* Provide an array of OpenTelemetry Instrumentations that should be registered.
69-
*
70-
* Use this option if you want to register OpenTelemetry instrumentation that the Sentry SDK does not yet have support for.
71-
*/
72-
openTelemetryInstrumentations?: Instrumentation[];
73-
74-
/**
75-
* Provide an array of additional OpenTelemetry SpanProcessors that should be registered.
76-
*/
77-
openTelemetrySpanProcessors?: SpanProcessor[];
78-
79-
/**
80-
* The max. duration in seconds that the SDK will wait for parent spans to be finished before discarding a span.
81-
* The SDK will automatically clean up spans that have no finished parent after this duration.
82-
* This is necessary to prevent memory leaks in case of parent spans that are never finished or otherwise dropped/missing.
83-
* However, if you have very long-running spans in your application, a shorter duration might cause spans to be discarded too early.
84-
* In this case, you can increase this duration to a value that fits your expected data.
85-
*
86-
* Defaults to 300 seconds (5 minutes).
87-
*/
88-
maxSpanWaitDuration?: number;
89-
9056
/**
9157
* Whether to register ESM loader hooks to automatically instrument libraries.
9258
* This is necessary to auto instrument libraries that are loaded via ESM imports, but it can cause issues
@@ -96,25 +62,6 @@ export interface BaseNodeOptions extends BaseWinterTCOptions {
9662
* Defaults to `true`.
9763
*/
9864
registerEsmLoaderHooks?: boolean;
99-
100-
/**
101-
* Configures in which interval client reports will be flushed. Defaults to `60_000` (milliseconds).
102-
*/
103-
clientReportFlushInterval?: number;
104-
105-
/**
106-
* By default, the SDK will try to identify problems with your instrumentation setup and warn you about it.
107-
* If you want to disable these warnings, set this to `true`.
108-
*/
109-
disableInstrumentationWarnings?: boolean;
110-
111-
/**
112-
* Controls how many milliseconds to wait before shutting down. The default is 2 seconds. Setting this too low can cause
113-
* problems for sending events from command line applications. Setting it too
114-
* high can cause the application to block for users with network connectivity
115-
* problems.
116-
*/
117-
shutdownTimeout?: number;
11865
}
11966

12067
/**

packages/node/src/types.ts

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { Span as WriteableSpan } from '@opentelemetry/api';
2-
import type { Instrumentation } from '@opentelemetry/instrumentation';
3-
import type { ReadableSpan, SpanProcessor } from '@opentelemetry/sdk-trace-base';
2+
import type { ReadableSpan } from '@opentelemetry/sdk-trace-base';
43
import type { BaseWinterTCOptions, ClientOptions, Options, SamplingContext, Scope, Span } from '@sentry/core';
54
import type { NodeTransportOptions } from '@sentry/node-core';
65

@@ -50,46 +49,13 @@ export interface BaseNodeOptions extends BaseWinterTCOptions {
5049
*/
5150
profileLifecycle?: 'manual' | 'trace';
5251

53-
/**
54-
* If set to `false`, the SDK will not automatically detect the `serverName`.
55-
*
56-
* This is useful if you are using the SDK in a CLI app or Electron where the
57-
* hostname might be considered PII.
58-
*
59-
* @default true
60-
*/
61-
includeServerName?: boolean;
62-
6352
/**
6453
* Include local variables with stack traces.
6554
*
6655
* Requires the `LocalVariables` integration.
6756
*/
6857
includeLocalVariables?: boolean;
6958

70-
/**
71-
* Provide an array of OpenTelemetry Instrumentations that should be registered.
72-
*
73-
* Use this option if you want to register OpenTelemetry instrumentation that the Sentry SDK does not yet have support for.
74-
*/
75-
openTelemetryInstrumentations?: Instrumentation[];
76-
77-
/**
78-
* Provide an array of additional OpenTelemetry SpanProcessors that should be registered.
79-
*/
80-
openTelemetrySpanProcessors?: SpanProcessor[];
81-
82-
/**
83-
* The max. duration in seconds that the SDK will wait for parent spans to be finished before discarding a span.
84-
* The SDK will automatically clean up spans that have no finished parent after this duration.
85-
* This is necessary to prevent memory leaks in case of parent spans that are never finished or otherwise dropped/missing.
86-
* However, if you have very long-running spans in your application, a shorter duration might cause spans to be discarded too early.
87-
* In this case, you can increase this duration to a value that fits your expected data.
88-
*
89-
* Defaults to 300 seconds (5 minutes).
90-
*/
91-
maxSpanWaitDuration?: number;
92-
9359
/**
9460
* Whether to register ESM loader hooks to automatically instrument libraries.
9561
* This is necessary to auto instrument libraries that are loaded via ESM imports, but it can cause issues
@@ -99,25 +65,6 @@ export interface BaseNodeOptions extends BaseWinterTCOptions {
9965
* Defaults to `true`.
10066
*/
10167
registerEsmLoaderHooks?: boolean;
102-
103-
/**
104-
* Configures in which interval client reports will be flushed. Defaults to `60_000` (milliseconds).
105-
*/
106-
clientReportFlushInterval?: number;
107-
108-
/**
109-
* By default, the SDK will try to identify problems with your instrumentation setup and warn you about it.
110-
* If you want to disable these warnings, set this to `true`.
111-
*/
112-
disableInstrumentationWarnings?: boolean;
113-
114-
/**
115-
* Controls how many milliseconds to wait before shutting down. The default is 2 seconds. Setting this too low can cause
116-
* problems for sending events from command line applications. Setting it too
117-
* high can cause the application to block for users with network connectivity
118-
* problems.
119-
*/
120-
shutdownTimeout?: number;
12168
}
12269

12370
/**

0 commit comments

Comments
 (0)