diff --git a/sentry_sdk/profiler/__init__.py b/sentry_sdk/profiler/__init__.py index d8d4e076d5..0bc63e3a6d 100644 --- a/sentry_sdk/profiler/__init__.py +++ b/sentry_sdk/profiler/__init__.py @@ -25,10 +25,10 @@ ) __all__ = [ - "start_profile_session", - "start_profiler", # TODO: Deprecate this in favor of `start_profile_session` - "stop_profile_session", - "stop_profiler", # TODO: Deprecate this in favor of `stop_profile_session` + "start_profile_session", # TODO: Deprecate this in favor of `start_profiler` + "start_profiler", + "stop_profile_session", # TODO: Deprecate this in favor of `stop_profiler` + "stop_profiler", # DEPRECATED: The following was re-exported for backwards compatibility. It # will be removed from sentry_sdk.profiler in a future release. "MAX_PROFILE_DURATION_NS", diff --git a/sentry_sdk/profiler/continuous_profiler.py b/sentry_sdk/profiler/continuous_profiler.py index 9e2aa35fc1..47f63d8f59 100644 --- a/sentry_sdk/profiler/continuous_profiler.py +++ b/sentry_sdk/profiler/continuous_profiler.py @@ -145,32 +145,32 @@ def try_profile_lifecycle_trace_start(): def start_profiler(): # type: () -> None + if _scheduler is None: + return - # TODO: deprecate this as it'll be replaced by `start_profile_session` - start_profile_session() + _scheduler.manual_start() def start_profile_session(): # type: () -> None - if _scheduler is None: - return - _scheduler.manual_start() + # TODO: deprecate this as it'll be replaced by `start_profiler` + start_profiler() def stop_profiler(): # type: () -> None + if _scheduler is None: + return - # TODO: deprecate this as it'll be replaced by `stop_profile_session` - stop_profile_session() + _scheduler.manual_stop() def stop_profile_session(): # type: () -> None - if _scheduler is None: - return - _scheduler.manual_stop() + # TODO: deprecate this as it'll be replaced by `stop_profiler` + stop_profiler() def teardown_continuous_profiler():