Skip to content

chore(profiler): Add deprecation warning for session functions #4171

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

Merged
merged 1 commit into from
Mar 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions sentry_sdk/profiler/continuous_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import threading
import time
import uuid
import warnings
from collections import deque
from datetime import datetime, timezone

Expand Down Expand Up @@ -154,7 +155,11 @@ def start_profiler():
def start_profile_session():
# type: () -> None

# TODO: deprecate this as it'll be replaced by `start_profiler`
warnings.warn(
"The `start_profile_session` function is deprecated. Please use `start_profile` instead.",
DeprecationWarning,
stacklevel=2,
)
start_profiler()


Expand All @@ -169,7 +174,11 @@ def stop_profiler():
def stop_profile_session():
# type: () -> None

# TODO: deprecate this as it'll be replaced by `stop_profiler`
warnings.warn(
"The `stop_profile_session` function is deprecated. Please use `stop_profile` instead.",
DeprecationWarning,
stacklevel=2,
)
stop_profiler()


Expand Down
Loading