Skip to content

fix(profiling-node): Respect profileSessionSampleRate in trace profile lifecycle - #22928

Open
Jxxunnn wants to merge 1 commit into
getsentry:developfrom
Jxxunnn:fix/profiling-node-trace-session-sample-rate
Open

fix(profiling-node): Respect profileSessionSampleRate in trace profile lifecycle#22928
Jxxunnn wants to merge 1 commit into
getsentry:developfrom
Jxxunnn:fix/profiling-node-trace-session-sample-rate

Conversation

@Jxxunnn

@Jxxunnn Jxxunnn commented Aug 1, 2026

Copy link
Copy Markdown
  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).
  • Link an issue if there is one related to your pull request. If no issue is linked, one will be auto-generated and linked.

Closes #22927

When using the trace profile lifecycle in @sentry/profiling-node, trace lifecycle profiling was set up without checking the session sampling decision. As a result, chunk profiling would start on span start even when profileSessionSampleRate resulted in an unsampled session.

This change skips trace lifecycle profiling setup when the session is not sampled, ensuring that profileSessionSampleRate is respected in the trace lifecycle as well.

A regression test was added for profileSessionSampleRate: 0 with the trace profile lifecycle.

@Jxxunnn
Jxxunnn requested a review from a team as a code owner August 1, 2026 09:14
@Jxxunnn
Jxxunnn requested review from andreiborza and mydea and removed request for a team August 1, 2026 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

profileSessionSampleRate is ignored when profileLifecycle is 'trace' (Node continuous profiling)

1 participant