Skip to content

Commit 63ef40e

Browse files
authored
feat(types): add profilesSampler option to node client type (#7385)
Thanks for the review @lforst!
1 parent ed1347e commit 63ef40e

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

packages/node/src/types.ts

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

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

@@ -8,6 +8,20 @@ export interface BaseNodeOptions {
88
*/
99
profilesSampleRate?: number;
1010

11+
/**
12+
* Function to compute profiling sample rate dynamically and filter unwanted profiles.
13+
*
14+
* Profiling is enabled if either this or `profilesSampleRate` is defined. If both are defined, `profilesSampleRate` is
15+
* ignored.
16+
*
17+
* Will automatically be passed a context object of default and optional custom data. See
18+
* {@link Transaction.samplingContext} and {@link Hub.startTransaction}.
19+
*
20+
* @returns A sample rate between 0 and 1 (0 drops the profile, 1 guarantees it will be sent). Returning `true` is
21+
* equivalent to returning 1 and returning `false` is equivalent to returning 0.
22+
*/
23+
profilesSampler?: (samplingContext: SamplingContext) => number | boolean;
24+
1125
/** Sets an optional server name (device name) */
1226
serverName?: string;
1327

0 commit comments

Comments
 (0)