Skip to content

Commit 0aa153f

Browse files
author
Luca Forstner
committed
Extract TracePropagationTargets type
1 parent 2756cfe commit 0aa153f

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

packages/node/src/integrations/http.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getCurrentHub, Hub } from '@sentry/core';
2-
import { EventProcessor, Integration, Span } from '@sentry/types';
2+
import { EventProcessor, Integration, Span, TracePropagationTargets } from '@sentry/types';
33
import { fill, isMatchingPattern, logger, mergeAndSerializeBaggage, parseSemver } from '@sentry/utils';
44
import * as http from 'http';
55
import * as https from 'https';
@@ -103,7 +103,7 @@ type WrappedRequestMethodFactory = (original: OriginalRequestMethod) => WrappedR
103103
function _createWrappedRequestMethodFactory(
104104
breadcrumbsEnabled: boolean,
105105
tracingEnabled: boolean,
106-
tracePropagationTargets: (string | RegExp)[] | undefined,
106+
tracePropagationTargets: TracePropagationTargets | undefined,
107107
): WrappedRequestMethodFactory {
108108
// We're caching results so we dont have to recompute regexp everytime we create a request.
109109
const urlMap: Record<string, boolean> = {};

packages/node/src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ClientOptions, Options } from '@sentry/types';
1+
import { ClientOptions, Options, TracePropagationTargets } from '@sentry/types';
22

33
import { NodeTransportOptions } from './transports';
44

@@ -17,7 +17,7 @@ export interface BaseNodeOptions {
1717
* request URL of outgoing requests against the items in this
1818
* array, and only attach tracing headers if a match was found.
1919
*/
20-
tracePropagationTargets?: (string | RegExp)[];
20+
tracePropagationTargets?: TracePropagationTargets;
2121

2222
/** Callback that is executed when a fatal global error occurs. */
2323
onFatalError?(error: Error): void;

packages/types/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export type { Hub } from './hub';
3737
export type { Integration, IntegrationClass } from './integration';
3838
export type { Mechanism } from './mechanism';
3939
export type { ExtractedNodeRequestData, HttpHeaderValue, Primitive, WorkerLocation } from './misc';
40-
export type { ClientOptions, Options } from './options';
40+
export type { ClientOptions, Options, TracePropagationTargets } from './options';
4141
export type { Package } from './package';
4242
export type { PolymorphicEvent } from './polymorphics';
4343
export type { QueryParams, Request } from './request';

packages/types/src/options.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { StackLineParser, StackParser } from './stacktrace';
77
import { SamplingContext } from './transaction';
88
import { BaseTransportOptions, Transport } from './transport';
99

10+
export type TracePropagationTargets = (string | RegExp)[];
11+
1012
export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOptions> {
1113
/**
1214
* Enable debug functionality in the SDK itself

0 commit comments

Comments
 (0)