Skip to content

Commit 0f95a68

Browse files
authored
chore(profiling): disable profiling on python 3.14 (#14669)
This change disables the Profiling product on Python 3.14 because it currently doesn't support Python 3.14. This was pulled from the 3.14 integration branch #14264
1 parent f98e713 commit 0f95a68

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

ddtrace/settings/profiling.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import itertools
22
import math
33
import os
4+
import sys
45
import typing as t
56

67
from ddtrace.ext.git import COMMIT_SHA
@@ -64,6 +65,9 @@ def _check_for_stack_v2_available():
6465

6566

6667
def _parse_profiling_enabled(raw: str) -> bool:
68+
if sys.version_info >= (3, 14):
69+
return False
70+
6771
# Try to derive whether we're enabled via DD_INJECTION_ENABLED
6872
# - Are we injected (DD_INJECTION_ENABLED set)
6973
# - Is profiling enabled ("profiler" in the list)
@@ -257,7 +261,8 @@ class ProfilingConfigStack(DDConfig):
257261
_v2_enabled = DDConfig.v(
258262
bool,
259263
"v2_enabled",
260-
default=True,
264+
# Not yet supported on 3.14
265+
default=sys.version_info < (3, 14),
261266
help_type="Boolean",
262267
help="Whether to enable the v2 stack profiler. Also enables the libdatadog collector.",
263268
)
@@ -370,12 +375,14 @@ class ProfilingConfigPytorch(DDConfig):
370375

371376
# We need to check if ddup is available, and turn off profiling if it is not.
372377
if not ddup_is_available:
373-
msg = ddup_failure_msg or "libdd not available"
374-
logger.warning("Failed to load ddup module (%s), disabling profiling", msg)
375-
telemetry_writer.add_log(
376-
TELEMETRY_LOG_LEVEL.ERROR,
377-
"Failed to load ddup module (%s), disabling profiling" % ddup_failure_msg,
378-
)
378+
# We know it is not supported on 3.14, so don't report the error, but still disable
379+
if sys.version_info < (3, 14):
380+
msg = ddup_failure_msg or "libdd not available"
381+
logger.warning("Failed to load ddup module (%s), disabling profiling", msg)
382+
telemetry_writer.add_log(
383+
TELEMETRY_LOG_LEVEL.ERROR,
384+
"Failed to load ddup module (%s), disabling profiling" % ddup_failure_msg,
385+
)
379386
config.enabled = False
380387

381388
# We also need to check if stack_v2 module is available, and turn if off

0 commit comments

Comments
 (0)