Skip to content

Commit 52d3882

Browse files
fix(jsdoc): tracePropagationTargets defaults are localhost and same origin in Browse (#8749)
1 parent bf3eb7f commit 52d3882

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

packages/node/src/types.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
1-
import type { ClientOptions, Options, SamplingContext } from '@sentry/types';
1+
import type { ClientOptions, Options, SamplingContext, TracePropagationTargets } from '@sentry/types';
22

33
import type { NodeClient } from './client';
44
import type { NodeTransportOptions } from './transports';
55

66
export interface BaseNodeOptions {
7+
/**
8+
* List of strings/regex controlling to which outgoing requests
9+
* the SDK will attach tracing headers.
10+
*
11+
* By default the SDK will attach those headers to all outgoing
12+
* requests. If this option is provided, the SDK will match the
13+
* request URL of outgoing requests against the items in this
14+
* array, and only attach tracing headers if a match was found.
15+
*
16+
* @example
17+
* ```js
18+
* Sentry.init({
19+
* tracePropagationTargets: ['api.site.com'],
20+
* });
21+
* ```
22+
*/
23+
tracePropagationTargets?: TracePropagationTargets;
24+
725
/**
826
* Sets profiling sample rate when @sentry/profiling-node is installed
927
*/

packages/types/src/options.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
226226
* List of strings/regex controlling to which outgoing requests
227227
* the SDK will attach tracing headers.
228228
*
229-
* By default the SDK will attach those headers to all outgoing
230-
* requests. If this option is provided, the SDK will match the
229+
* By default the SDK will attach those headers to all requests to localhost
230+
* and same origin. If this option is provided, the SDK will match the
231231
* request URL of outgoing requests against the items in this
232232
* array, and only attach tracing headers if a match was found.
233233
*
@@ -237,6 +237,8 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
237237
* tracePropagationTargets: ['api.site.com'],
238238
* });
239239
* ```
240+
*
241+
* Default: ['localhost', /^\//] {@see DEFAULT_TRACE_PROPAGATION_TARGETS}
240242
*/
241243
tracePropagationTargets?: TracePropagationTargets;
242244

0 commit comments

Comments
 (0)