diff --git a/packages/node/src/types.ts b/packages/node/src/types.ts index 4d384bc54cf3..dd4713e97952 100644 --- a/packages/node/src/types.ts +++ b/packages/node/src/types.ts @@ -1,4 +1,4 @@ -import type { ClientOptions, Options, TracePropagationTargets } from '@sentry/types'; +import type { ClientOptions, Options, SamplingContext, TracePropagationTargets } from '@sentry/types'; import type { NodeTransportOptions } from './transports'; @@ -8,6 +8,20 @@ export interface BaseNodeOptions { */ profilesSampleRate?: number; + /** + * Function to compute profiling sample rate dynamically and filter unwanted profiles. + * + * Profiling is enabled if either this or `profilesSampleRate` is defined. If both are defined, `profilesSampleRate` is + * ignored. + * + * Will automatically be passed a context object of default and optional custom data. See + * {@link Transaction.samplingContext} and {@link Hub.startTransaction}. + * + * @returns A sample rate between 0 and 1 (0 drops the profile, 1 guarantees it will be sent). Returning `true` is + * equivalent to returning 1 and returning `false` is equivalent to returning 0. + */ + profilesSampler?: (samplingContext: SamplingContext) => number | boolean; + /** Sets an optional server name (device name) */ serverName?: string;