Skip to content

feat(profiling): allow profiling before the SDK inits - #2280

Open
Litarnus wants to merge 1 commit into
continuous-profiling-19-restart-in-forked-processfrom
continuous-profiling-20-start-before-init
Open

Litarnus wants to merge 1 commit into
continuous-profiling-19-restart-in-forked-processfrom
continuous-profiling-20-start-before-init

Conversation

@Litarnus

Copy link
Copy Markdown
Collaborator

Allows to start manual profiling before the SDK was initialised (and thus missing sampling decisions). Once a client is bound, it will either keep the samples or discard them, depending on the SDK options.

@Litarnus
Litarnus added this pull request to stack #2262 October 17, 2026 15:50

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread src/Profiling/ContinuousProfiler.php
@Litarnus
Litarnus force-pushed the continuous-profiling-20-start-before-init branch from b44483f to f23eadd Compare October 17, 2026 15:59
@Litarnus
Litarnus force-pushed the continuous-profiling-20-start-before-init branch from f23eadd to 3d61d82 Compare October 17, 2026 23:07
@Litarnus
Litarnus removed this pull request from stack #2262 October 17, 2026 23:14

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread src/Profiling/ContinuousProfiler.php
@Litarnus
Litarnus added this pull request to stack #2282 October 17, 2026 23:16
@Litarnus
Litarnus force-pushed the continuous-profiling-20-start-before-init branch from 3d61d82 to 8ee69f5 Compare October 18, 2026 10:45
@Litarnus
Litarnus force-pushed the continuous-profiling-20-start-before-init branch from 8ee69f5 to b751ab8 Compare October 18, 2026 14:53
@Litarnus
Litarnus force-pushed the continuous-profiling-20-start-before-init branch from b751ab8 to 1939d55 Compare October 18, 2026 19:19
@Litarnus
Litarnus force-pushed the continuous-profiling-20-start-before-init branch from 1939d55 to dbecf4e Compare October 18, 2026 19:47

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit dbecf4e. Configure here.

$this->profiler->stop();

$this->clearProfiler();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Client bind skips forked profiler restart

Low Severity

onClientBound never calls restartInForkedProcess before keeping or tearing down a profiler. After pcntl_fork between a pre-init start() and client bind, a child can keep an inherited Excimer instance that does not sample, or emit warnings from stop() and teardown, because that timer does not exist in the child.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit dbecf4e. Configure here.

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.

1 participant