Skip to content

docs(profiling): Fix stale comment referencing removed start_profiling - #8401

Merged
sentrivana merged 1 commit into
masterfrom
docs/continuous-profiler-auto-start-comment
Nov 26, 2026
Merged

sentrivana merged 1 commit into
masterfrom
docs/continuous-profiler-auto-start-comment

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Description

This PR only changes a comment, in sentry_sdk/profiler/continuous_profiler.py (ContinuousScheduler.make_sampler, line 322). No code changes.

Old comment:

# Move the new profiles into the active_profiles set.
#
# We cannot directly add the to active_profiles set
# in `start_profiling` because it is called from other
# threads which can cause a RuntimeError when it the
# set sizes changes during iteration without a lock.

Why it's inaccurate: start_profiling doesn't exist anywhere in sentry_sdk/. 2b067e953 (#4017) copied this comment from the transaction profiler, where Scheduler.start_profiling appended to new_profiles. In the continuous profiler, that same commit added ContinuousScheduler.auto_start as the method that does self.new_profiles.append(profile) (line 242). It is called through try_profile_lifecycle_trace_start() when a segment span starts (sentry_sdk/traces.py, _start_profile), so it runs on whatever thread starts the span. Then 123c21404 (#6921) removed the transaction profiler, and start_profiling went with it.

Fix: I kept the comment because it explains why profiles go through the new_profiles deque and don't get added to the set directly. I only changed the method name to auto_start.

Issues

n/a

via automation sched_7b023adc5c6d74c9739cbbdca1ed3cf8 · Run ID sched_7b023adc5c6d74c9739cbbdca1ed3cf8:1795680000000.

--

View Session [Sentry]

@sentry-junior
sentry-junior Bot requested a review from a team as a code owner November 26, 2026 08:02
@sentrivana
sentrivana enabled auto-merge (squash) November 26, 2026 08:06
@sentrivana
sentrivana merged commit 76eae45 into master Nov 26, 2026
173 checks passed
@sentrivana
sentrivana deleted the docs/continuous-profiler-auto-start-comment branch November 26, 2026 08:08
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Results 📊

✅ 59457 passed | ⏭️ 3119 skipped | Total: 62576 | Pass Rate: 95.02% | Execution Time: 161m 49s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +288
Passed Tests 📈 +216
Failed Tests —
Skipped Tests 📈 +72

All tests are passing successfully.

✅ Patch coverage is 100.00% (no changed executable lines found; target 80%).
Project statement coverage is 90.12%.

Files with missing lines (1)
File Coverage % Lines
sentry_sdk/profiler/continuous_profiler.py 93.00% ⚠️ 21 Missing and 11 partials

Generated by Coverage Action

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