Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(types): Add profilesSampler option to node client type #7385

Merged
merged 1 commit into from
Mar 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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