Skip to content

Commit

Permalink
feat(types): add profilesSampler option to node client type
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasBa committed Mar 8, 2023
1 parent 2b44452 commit 3d1af3f
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion packages/node/src/types.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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;

Expand Down

0 comments on commit 3d1af3f

Please sign in to comment.