From 0aef6d88d02b4a7d34331c2bae6bce4886b68f3d Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Tue, 11 Nov 2025 12:29:11 -0500 Subject: [PATCH 1/7] chore(profiling): dont turn off all profiling when stack profiler is not available --- ddtrace/internal/settings/profiling.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ddtrace/internal/settings/profiling.py b/ddtrace/internal/settings/profiling.py index b9dc489dd17..8b6a015a13e 100644 --- a/ddtrace/internal/settings/profiling.py +++ b/ddtrace/internal/settings/profiling.py @@ -397,7 +397,6 @@ class ProfilingConfigPytorch(DDConfig): ) config.stack.v2_enabled = False config.stack.enabled = False - config.enabled = False # Enrich tags with git metadata and DD_TAGS config.tags = _enrich_tags(config.tags) From 980003c80f8fd69b9d8cf3e0ea213a77c4597819 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Tue, 11 Nov 2025 12:44:50 -0500 Subject: [PATCH 2/7] remove `DD_PROFILING_STACK_V2_ENABLED` --- ddtrace/internal/settings/profiling.py | 22 +++---------------- ddtrace/profiling/_asyncio.py | 2 +- ddtrace/profiling/collector/_task.pyx | 2 +- ddtrace/profiling/collector/stack.pyx | 2 +- ddtrace/profiling/collector/threading.py | 2 +- ddtrace/profiling/profiler.py | 2 -- .../collector/test_stack_asyncio.py | 12 +++++----- tests/profiling_v2/simple_program.py | 1 - tests/profiling_v2/test_main.py | 3 +-- 9 files changed, 13 insertions(+), 35 deletions(-) diff --git a/ddtrace/internal/settings/profiling.py b/ddtrace/internal/settings/profiling.py index 8b6a015a13e..82653d97642 100644 --- a/ddtrace/internal/settings/profiling.py +++ b/ddtrace/internal/settings/profiling.py @@ -253,23 +253,11 @@ class ProfilingConfigStack(DDConfig): enabled = DDConfig.v( bool, "enabled", - default=True, - help_type="Boolean", - help="Whether to enable the stack profiler", - ) - - _v2_enabled = DDConfig.v( - bool, - "v2_enabled", - # Not yet supported on 3.14 default=sys.version_info < (3, 14), help_type="Boolean", - help="Whether to enable the v2 stack profiler. Also enables the libdatadog collector.", + help="Whether to enable the stack profiler", ) - # V2 can't be enabled if stack collection is disabled or if pre-requisites are not met - v2_enabled = DDConfig.d(bool, lambda c: c._v2_enabled and c.enabled) - v2_adaptive_sampling = DDConfig.v( bool, "v2.adaptive_sampling.enabled", @@ -388,14 +376,13 @@ class ProfilingConfigPytorch(DDConfig): # We also need to check if stack_v2 module is available, and turn if off # if it s not. stack_v2_failure_msg, stack_v2_is_available = _check_for_stack_v2_available() -if config.stack.v2_enabled and not stack_v2_is_available: +if config.stack.enabled and not stack_v2_is_available: msg = stack_v2_failure_msg or "stack_v2 not available" logger.warning("Failed to load stack_v2 module (%s), falling back to v1 stack sampler", msg) telemetry_writer.add_log( TELEMETRY_LOG_LEVEL.ERROR, "Failed to load stack_v2 module (%s), disabling profiling" % msg, ) - config.stack.v2_enabled = False config.stack.enabled = False # Enrich tags with git metadata and DD_TAGS @@ -405,10 +392,7 @@ class ProfilingConfigPytorch(DDConfig): def config_str(config): configured_features = [] if config.stack.enabled: - if config.stack.v2_enabled: - configured_features.append("stack_v2") - else: - configured_features.append("stack") + configured_features.append("stack_v2") if config.lock.enabled: configured_features.append("lock") if config.memory.enabled: diff --git a/ddtrace/profiling/_asyncio.py b/ddtrace/profiling/_asyncio.py index b307917aa39..967c3081d3f 100644 --- a/ddtrace/profiling/_asyncio.py +++ b/ddtrace/profiling/_asyncio.py @@ -98,7 +98,7 @@ def _(asyncio: ModuleType) -> None: if THREAD_LINK is None: THREAD_LINK = _threading._ThreadLink() - init_stack_v2: bool = config.stack.v2_enabled and stack_v2.is_available + init_stack_v2: bool = config.stack.enabled and stack_v2.is_available @partial(wrap, sys.modules["asyncio.events"].BaseDefaultEventLoopPolicy.set_event_loop) def _(f, args, kwargs): diff --git a/ddtrace/profiling/collector/_task.pyx b/ddtrace/profiling/collector/_task.pyx index b688d9c6bd6..c2b0b5e051a 100644 --- a/ddtrace/profiling/collector/_task.pyx +++ b/ddtrace/profiling/collector/_task.pyx @@ -9,7 +9,7 @@ from .. import _threading from ddtrace.internal.settings.profiling import config -if (is_stack_v2 := config.stack.v2_enabled): +if (is_stack_v2 := config.stack.enabled): @when_imported("gevent") def _(gevent): diff --git a/ddtrace/profiling/collector/stack.pyx b/ddtrace/profiling/collector/stack.pyx index b123d4055a5..943168dd979 100644 --- a/ddtrace/profiling/collector/stack.pyx +++ b/ddtrace/profiling/collector/stack.pyx @@ -419,7 +419,7 @@ class StackCollector(collector.PeriodicCollector): ignore_profiler: bool = config.ignore_profiler, endpoint_collection_enabled: typing.Optional[bool] = None, tracer: typing.Optional[Tracer] = None, - _stack_collector_v2_enabled: bool = config.stack.v2_enabled): + _stack_collector_v2_enabled: bool = config.stack.enabled): super().__init__(interval= _default_min_interval_time()) if max_time_usage_pct <= 0 or max_time_usage_pct > 100: raise ValueError("Max time usage percent must be greater than 0 and smaller or equal to 100") diff --git a/ddtrace/profiling/collector/threading.py b/ddtrace/profiling/collector/threading.py index 28a4b49fc96..dc1f1404546 100644 --- a/ddtrace/profiling/collector/threading.py +++ b/ddtrace/profiling/collector/threading.py @@ -50,7 +50,7 @@ def _set_patch_target( # Also patch threading.Thread so echion can track thread lifetimes def init_stack_v2() -> None: - if config.stack.v2_enabled and stack_v2.is_available: + if config.stack.enabled and stack_v2.is_available: _thread_set_native_id = ddtrace_threading.Thread._set_native_id # type: ignore[attr-defined] _thread_bootstrap_inner = ddtrace_threading.Thread._bootstrap_inner # type: ignore[attr-defined] diff --git a/ddtrace/profiling/profiler.py b/ddtrace/profiling/profiler.py index 68f4fb372f7..f7d14d6d9bc 100644 --- a/ddtrace/profiling/profiler.py +++ b/ddtrace/profiling/profiler.py @@ -124,7 +124,6 @@ def __init__( api_key: Optional[str] = None, _memory_collector_enabled: bool = profiling_config.memory.enabled, _stack_collector_enabled: bool = profiling_config.stack.enabled, - _stack_v2_enabled: bool = profiling_config.stack.v2_enabled, _lock_collector_enabled: bool = profiling_config.lock.enabled, _pytorch_collector_enabled: bool = profiling_config.pytorch.enabled, enable_code_provenance: bool = profiling_config.code_provenance, @@ -140,7 +139,6 @@ def __init__( self.api_key: Optional[str] = api_key if api_key is not None else config._dd_api_key self._memory_collector_enabled: bool = _memory_collector_enabled self._stack_collector_enabled: bool = _stack_collector_enabled - self._stack_v2_enabled: bool = _stack_v2_enabled self._lock_collector_enabled: bool = _lock_collector_enabled self._pytorch_collector_enabled: bool = _pytorch_collector_enabled self.enable_code_provenance: bool = enable_code_provenance diff --git a/tests/profiling_v2/collector/test_stack_asyncio.py b/tests/profiling_v2/collector/test_stack_asyncio.py index a6375569b9d..e9c93449ecb 100644 --- a/tests/profiling_v2/collector/test_stack_asyncio.py +++ b/tests/profiling_v2/collector/test_stack_asyncio.py @@ -40,7 +40,6 @@ async def hello(): span_type = ext.SpanTypes.WEB p = profiler.Profiler(tracer=tracer) - assert p._profiler._stack_v2_enabled p.start() with tracer.trace("test_asyncio", resource=resource, span_type=span_type) as span: span_id = span.span_id @@ -135,7 +134,6 @@ def test_asyncio_start_profiler_from_process_before_importing_asyncio(): assert stack_v2.is_available, stack_v2.failure_msg p = profiler.Profiler() - assert p._profiler._stack_v2_enabled p.start() import asyncio @@ -265,7 +263,7 @@ def test_asyncio_start_profiler_from_process_before_starting_loop(): assert stack_v2.is_available, stack_v2.failure_msg p = profiler.Profiler() - assert p._profiler._stack_v2_enabled + p.start() # Start an asyncio loop BEFORE importing profiler modules @@ -396,7 +394,7 @@ def test_asyncio_start_profiler_from_process_after_creating_loop(): assert stack_v2.is_available, stack_v2.failure_msg p = profiler.Profiler() - assert p._profiler._stack_v2_enabled + p.start() async def my_function(): @@ -522,7 +520,7 @@ def test_asyncio_import_profiler_from_process_after_starting_loop(): assert stack_v2.is_available, stack_v2.failure_msg p = profiler.Profiler() - assert p._profiler._stack_v2_enabled + p.start() async def my_function(): @@ -659,7 +657,7 @@ async def background_task_func() -> None: assert stack_v2.is_available, stack_v2.failure_msg p = profiler.Profiler() - assert p._profiler._stack_v2_enabled + p.start() # Run tasks that should be tracked @@ -787,7 +785,7 @@ async def background_task_func() -> None: assert stack_v2.is_available, stack_v2.failure_msg p = profiler.Profiler() - assert p._profiler._stack_v2_enabled + p.start() # Run tasks that should be tracked diff --git a/tests/profiling_v2/simple_program.py b/tests/profiling_v2/simple_program.py index ed07bc5a402..b0d91cec73d 100755 --- a/tests/profiling_v2/simple_program.py +++ b/tests/profiling_v2/simple_program.py @@ -28,5 +28,4 @@ object() print(os.getpid()) -print(bootstrap.profiler._profiler._stack_v2_enabled) sys.exit(42) diff --git a/tests/profiling_v2/test_main.py b/tests/profiling_v2/test_main.py index cbd10b294a6..dff3ab2397e 100644 --- a/tests/profiling_v2/test_main.py +++ b/tests/profiling_v2/test_main.py @@ -20,10 +20,9 @@ def test_call_script(): assert exitcode == 0, (stdout, stderr) else: assert exitcode == 42, (stdout, stderr) - hello, interval, pid, stack_v2 = list(s.strip() for s in stdout.decode().strip().split("\n")) + hello, interval, pid = list(s.strip() for s in stdout.decode().strip().split("\n")) assert hello == "hello world", stdout.decode().strip() assert float(interval) >= 0.01, stdout.decode().strip() - assert stack_v2 == str(True) @pytest.mark.skipif(not os.getenv("DD_PROFILE_TEST_GEVENT", False), reason="Not testing gevent") From 43ddbc6bd8e7c3d042b47265418173c341533f24 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Tue, 11 Nov 2025 12:46:43 -0500 Subject: [PATCH 3/7] update telemetry writer test --- tests/telemetry/test_writer.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/telemetry/test_writer.py b/tests/telemetry/test_writer.py index 2af65e25632..a096a4fdf8f 100644 --- a/tests/telemetry/test_writer.py +++ b/tests/telemetry/test_writer.py @@ -307,7 +307,6 @@ def test_app_started_event_configuration_override(test_agent_session, run_python {"name": "DD_PROFILING_PYTORCH_EVENTS_LIMIT", "origin": "default", "value": 1000000}, {"name": "DD_PROFILING_SAMPLE_POOL_CAPACITY", "origin": "default", "value": 4}, {"name": "DD_PROFILING_STACK_ENABLED", "origin": "env_var", "value": False}, - {"name": "DD_PROFILING_STACK_V2_ENABLED", "origin": "default", "value": PYTHON_VERSION_INFO < (3, 14)}, {"name": "DD_PROFILING_TAGS", "origin": "default", "value": ""}, {"name": "DD_PROFILING_TIMELINE_ENABLED", "origin": "default", "value": True}, {"name": "DD_PROFILING_UPLOAD_INTERVAL", "origin": "env_var", "value": 10.0}, From 1436621ee864349664d5067cc313f9a130fc0722 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Tue, 11 Nov 2025 12:49:12 -0500 Subject: [PATCH 4/7] remove newlines --- tests/profiling_v2/collector/test_stack_asyncio.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/profiling_v2/collector/test_stack_asyncio.py b/tests/profiling_v2/collector/test_stack_asyncio.py index e9c93449ecb..a13ea2aaad9 100644 --- a/tests/profiling_v2/collector/test_stack_asyncio.py +++ b/tests/profiling_v2/collector/test_stack_asyncio.py @@ -263,7 +263,6 @@ def test_asyncio_start_profiler_from_process_before_starting_loop(): assert stack_v2.is_available, stack_v2.failure_msg p = profiler.Profiler() - p.start() # Start an asyncio loop BEFORE importing profiler modules @@ -394,7 +393,6 @@ def test_asyncio_start_profiler_from_process_after_creating_loop(): assert stack_v2.is_available, stack_v2.failure_msg p = profiler.Profiler() - p.start() async def my_function(): @@ -520,7 +518,6 @@ def test_asyncio_import_profiler_from_process_after_starting_loop(): assert stack_v2.is_available, stack_v2.failure_msg p = profiler.Profiler() - p.start() async def my_function(): @@ -657,7 +654,6 @@ async def background_task_func() -> None: assert stack_v2.is_available, stack_v2.failure_msg p = profiler.Profiler() - p.start() # Run tasks that should be tracked @@ -785,7 +781,6 @@ async def background_task_func() -> None: assert stack_v2.is_available, stack_v2.failure_msg p = profiler.Profiler() - p.start() # Run tasks that should be tracked From 12d42b991672267f1672cf7dd049f588de4de906 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Tue, 11 Nov 2025 12:55:28 -0500 Subject: [PATCH 5/7] remove riot venvs --- .github/workflows/django-overhead-profile.yml | 10 +- .riot/requirements/11f199b.txt | 34 ------ .riot/requirements/156272b.txt | 27 ----- .riot/requirements/1732d2c.txt | 30 ------ .riot/requirements/17dacc9.txt | 27 ----- .riot/requirements/18f25af.txt | 27 ----- .riot/requirements/19a46f0.txt | 32 ------ .riot/requirements/19dd610.txt | 32 ------ .riot/requirements/1a21c9f.txt | 34 ------ .riot/requirements/33ce309.txt | 27 ----- .riot/requirements/34a1fc3.txt | 30 ------ .riot/requirements/3c0f573.txt | 37 ------- .riot/requirements/57ce041.txt | 27 ----- .riot/requirements/6f7b1a1.txt | 37 ------- .riot/requirements/768e5b9.txt | 27 ----- .riot/requirements/7ab50e4.txt | 39 ------- .riot/requirements/83c892b.txt | 34 ------ riotfile.py | 100 ------------------ tests/profiling/suitespec.yml | 13 --- 19 files changed, 1 insertion(+), 623 deletions(-) delete mode 100644 .riot/requirements/11f199b.txt delete mode 100644 .riot/requirements/156272b.txt delete mode 100644 .riot/requirements/1732d2c.txt delete mode 100644 .riot/requirements/17dacc9.txt delete mode 100644 .riot/requirements/18f25af.txt delete mode 100644 .riot/requirements/19a46f0.txt delete mode 100644 .riot/requirements/19dd610.txt delete mode 100644 .riot/requirements/1a21c9f.txt delete mode 100644 .riot/requirements/33ce309.txt delete mode 100644 .riot/requirements/34a1fc3.txt delete mode 100644 .riot/requirements/3c0f573.txt delete mode 100644 .riot/requirements/57ce041.txt delete mode 100644 .riot/requirements/6f7b1a1.txt delete mode 100644 .riot/requirements/768e5b9.txt delete mode 100644 .riot/requirements/7ab50e4.txt delete mode 100644 .riot/requirements/83c892b.txt diff --git a/.github/workflows/django-overhead-profile.yml b/.github/workflows/django-overhead-profile.yml index b04199cb57f..01d9326b2b6 100644 --- a/.github/workflows/django-overhead-profile.yml +++ b/.github/workflows/django-overhead-profile.yml @@ -13,18 +13,10 @@ on: jobs: django-overhead-profile: runs-on: ubuntu-latest - strategy: - matrix: - include: - - suffix: "-v1" - stack_v2: "0" - - suffix: "-v2" - stack_v2: "1" env: PREFIX: ${{ github.workspace }}/prefix DD_CODE_ORIGIN_FOR_SPANS_ENABLED: "1" DD_PROFILING_ENABLED: "1" - DD_PROFILING_STACK_V2_ENABLED: ${{ matrix.stack_v2 }} DD_PROFILING_OUTPUT_PPROF: ${{ github.workspace }}/prefix/artifacts/ddtrace_profile DD_EXCEPTION_REPLAY_ENABLED: "1" defaults: @@ -50,5 +42,5 @@ jobs: - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: - name: django-overhead-profile${{ matrix.suffix }} + name: django-overhead-profile path: ${{ github.workspace }}/prefix/artifacts diff --git a/.riot/requirements/11f199b.txt b/.riot/requirements/11f199b.txt deleted file mode 100644 index 288e0e3aee0..00000000000 --- a/.riot/requirements/11f199b.txt +++ /dev/null @@ -1,34 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.13 -# by the following command: -# -# pip-compile --allow-unsafe --no-annotate .riot/requirements/11f199b.in -# -attrs==25.4.0 -coverage[toml]==7.11.0 -gevent==25.9.1 -greenlet==3.2.4 -gunicorn[gevent]==23.0.0 -hypothesis==6.45.0 -iniconfig==2.3.0 -mock==5.2.0 -opentracing==2.4.0 -packaging==25.0 -pluggy==1.6.0 -protobuf==6.33.0 -py-cpuinfo==8.0.0 -pygments==2.19.2 -pytest==8.4.2 -pytest-asyncio==0.21.1 -pytest-benchmark==5.2.1 -pytest-cov==7.0.0 -pytest-mock==3.15.1 -pytest-randomly==4.0.1 -sortedcontainers==2.4.0 -uwsgi==2.0.31 -zope-event==6.0 -zope-interface==8.0.1 -zstandard==0.25.0 - -# The following packages are considered to be unsafe in a requirements file: -setuptools==80.9.0 diff --git a/.riot/requirements/156272b.txt b/.riot/requirements/156272b.txt deleted file mode 100644 index 5bea558cda4..00000000000 --- a/.riot/requirements/156272b.txt +++ /dev/null @@ -1,27 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.13 -# by the following command: -# -# pip-compile --allow-unsafe --no-annotate .riot/requirements/156272b.in -# -attrs==25.4.0 -coverage[toml]==7.11.0 -gunicorn==23.0.0 -hypothesis==6.45.0 -iniconfig==2.3.0 -mock==5.2.0 -opentracing==2.4.0 -packaging==25.0 -pluggy==1.6.0 -protobuf==6.33.0 -py-cpuinfo==8.0.0 -pygments==2.19.2 -pytest==8.4.2 -pytest-asyncio==0.21.1 -pytest-benchmark==5.2.1 -pytest-cov==7.0.0 -pytest-mock==3.15.1 -pytest-randomly==4.0.1 -sortedcontainers==2.4.0 -uwsgi==2.0.31 -zstandard==0.25.0 diff --git a/.riot/requirements/1732d2c.txt b/.riot/requirements/1732d2c.txt deleted file mode 100644 index 76ee383c7ea..00000000000 --- a/.riot/requirements/1732d2c.txt +++ /dev/null @@ -1,30 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.10 -# by the following command: -# -# pip-compile --allow-unsafe --no-annotate .riot/requirements/1732d2c.in -# -attrs==25.4.0 -coverage[toml]==7.11.0 -exceptiongroup==1.3.0 -gunicorn==23.0.0 -hypothesis==6.45.0 -iniconfig==2.3.0 -mock==5.2.0 -opentracing==2.4.0 -packaging==25.0 -pluggy==1.6.0 -protobuf==6.33.0 -py-cpuinfo==8.0.0 -pygments==2.19.2 -pytest==8.4.2 -pytest-asyncio==0.21.1 -pytest-benchmark==5.2.1 -pytest-cov==7.0.0 -pytest-mock==3.15.1 -pytest-randomly==4.0.1 -sortedcontainers==2.4.0 -tomli==2.3.0 -typing-extensions==4.15.0 -uwsgi==2.0.31 -zstandard==0.25.0 diff --git a/.riot/requirements/17dacc9.txt b/.riot/requirements/17dacc9.txt deleted file mode 100644 index ebc39a6a11b..00000000000 --- a/.riot/requirements/17dacc9.txt +++ /dev/null @@ -1,27 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.11 -# by the following command: -# -# pip-compile --allow-unsafe --no-annotate .riot/requirements/17dacc9.in -# -attrs==25.4.0 -coverage[toml]==7.11.0 -gunicorn==23.0.0 -hypothesis==6.45.0 -iniconfig==2.3.0 -mock==5.2.0 -opentracing==2.4.0 -packaging==25.0 -pluggy==1.6.0 -protobuf==6.33.0 -py-cpuinfo==8.0.0 -pygments==2.19.2 -pytest==8.4.2 -pytest-asyncio==0.21.1 -pytest-benchmark==5.2.1 -pytest-cov==7.0.0 -pytest-mock==3.15.1 -pytest-randomly==4.0.1 -sortedcontainers==2.4.0 -uwsgi==2.0.31 -zstandard==0.25.0 diff --git a/.riot/requirements/18f25af.txt b/.riot/requirements/18f25af.txt deleted file mode 100644 index f60e2fd1d12..00000000000 --- a/.riot/requirements/18f25af.txt +++ /dev/null @@ -1,27 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.13 -# by the following command: -# -# pip-compile --allow-unsafe --no-annotate .riot/requirements/18f25af.in -# -attrs==25.4.0 -coverage[toml]==7.11.0 -gunicorn==23.0.0 -hypothesis==6.45.0 -iniconfig==2.3.0 -mock==5.2.0 -opentracing==2.4.0 -packaging==25.0 -pluggy==1.6.0 -protobuf==4.22.0 -py-cpuinfo==8.0.0 -pygments==2.19.2 -pytest==8.4.2 -pytest-asyncio==0.21.1 -pytest-benchmark==5.2.1 -pytest-cov==7.0.0 -pytest-mock==3.15.1 -pytest-randomly==4.0.1 -sortedcontainers==2.4.0 -uwsgi==2.0.31 -zstandard==0.25.0 diff --git a/.riot/requirements/19a46f0.txt b/.riot/requirements/19a46f0.txt deleted file mode 100644 index 5310868d43e..00000000000 --- a/.riot/requirements/19a46f0.txt +++ /dev/null @@ -1,32 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.9 -# by the following command: -# -# pip-compile --allow-unsafe --no-annotate .riot/requirements/19a46f0.in -# -attrs==25.4.0 -coverage[toml]==7.10.7 -exceptiongroup==1.3.0 -gunicorn==23.0.0 -hypothesis==6.45.0 -importlib-metadata==8.7.0 -iniconfig==2.1.0 -mock==5.2.0 -opentracing==2.4.0 -packaging==25.0 -pluggy==1.6.0 -protobuf==6.33.0 -py-cpuinfo==8.0.0 -pygments==2.19.2 -pytest==8.4.2 -pytest-asyncio==0.21.1 -pytest-benchmark==5.2.1 -pytest-cov==7.0.0 -pytest-mock==3.15.1 -pytest-randomly==4.0.1 -sortedcontainers==2.4.0 -tomli==2.3.0 -typing-extensions==4.15.0 -uwsgi==2.0.31 -zipp==3.23.0 -zstandard==0.25.0 diff --git a/.riot/requirements/19dd610.txt b/.riot/requirements/19dd610.txt deleted file mode 100644 index 6c6db530273..00000000000 --- a/.riot/requirements/19dd610.txt +++ /dev/null @@ -1,32 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.9 -# by the following command: -# -# pip-compile --allow-unsafe --no-annotate .riot/requirements/19dd610.in -# -attrs==25.4.0 -coverage[toml]==7.10.7 -exceptiongroup==1.3.0 -gunicorn==23.0.0 -hypothesis==6.45.0 -importlib-metadata==8.7.0 -iniconfig==2.1.0 -mock==5.2.0 -opentracing==2.4.0 -packaging==25.0 -pluggy==1.6.0 -protobuf==6.33.0 -py-cpuinfo==8.0.0 -pygments==2.19.2 -pytest==8.4.2 -pytest-asyncio==0.21.1 -pytest-benchmark==5.2.1 -pytest-cov==7.0.0 -pytest-mock==3.15.1 -pytest-randomly==4.0.1 -sortedcontainers==2.4.0 -tomli==2.3.0 -typing-extensions==4.15.0 -uwsgi==2.0.31 -zipp==3.23.0 -zstandard==0.25.0 diff --git a/.riot/requirements/1a21c9f.txt b/.riot/requirements/1a21c9f.txt deleted file mode 100644 index cf8b0fcebdf..00000000000 --- a/.riot/requirements/1a21c9f.txt +++ /dev/null @@ -1,34 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.11 -# by the following command: -# -# pip-compile --allow-unsafe --no-annotate .riot/requirements/1a21c9f.in -# -attrs==25.4.0 -coverage[toml]==7.11.0 -gevent==25.9.1 -greenlet==3.2.4 -gunicorn[gevent]==23.0.0 -hypothesis==6.45.0 -iniconfig==2.3.0 -mock==5.2.0 -opentracing==2.4.0 -packaging==25.0 -pluggy==1.6.0 -protobuf==6.33.0 -py-cpuinfo==8.0.0 -pygments==2.19.2 -pytest==8.4.2 -pytest-asyncio==0.21.1 -pytest-benchmark==5.2.1 -pytest-cov==7.0.0 -pytest-mock==3.15.1 -pytest-randomly==4.0.1 -sortedcontainers==2.4.0 -uwsgi==2.0.31 -zope-event==6.0 -zope-interface==8.0.1 -zstandard==0.25.0 - -# The following packages are considered to be unsafe in a requirements file: -setuptools==80.9.0 diff --git a/.riot/requirements/33ce309.txt b/.riot/requirements/33ce309.txt deleted file mode 100644 index ba7c81d2662..00000000000 --- a/.riot/requirements/33ce309.txt +++ /dev/null @@ -1,27 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# pip-compile --allow-unsafe --no-annotate .riot/requirements/33ce309.in -# -attrs==25.4.0 -coverage[toml]==7.11.0 -gunicorn==23.0.0 -hypothesis==6.45.0 -iniconfig==2.3.0 -mock==5.2.0 -opentracing==2.4.0 -packaging==25.0 -pluggy==1.6.0 -protobuf==4.22.0 -py-cpuinfo==8.0.0 -pygments==2.19.2 -pytest==8.4.2 -pytest-asyncio==0.21.1 -pytest-benchmark==5.2.1 -pytest-cov==7.0.0 -pytest-mock==3.15.1 -pytest-randomly==4.0.1 -sortedcontainers==2.4.0 -uwsgi==2.0.31 -zstandard==0.25.0 diff --git a/.riot/requirements/34a1fc3.txt b/.riot/requirements/34a1fc3.txt deleted file mode 100644 index c5a744026e8..00000000000 --- a/.riot/requirements/34a1fc3.txt +++ /dev/null @@ -1,30 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.10 -# by the following command: -# -# pip-compile --allow-unsafe --no-annotate .riot/requirements/34a1fc3.in -# -attrs==25.4.0 -coverage[toml]==7.11.0 -exceptiongroup==1.3.0 -gunicorn==23.0.0 -hypothesis==6.45.0 -iniconfig==2.3.0 -mock==5.2.0 -opentracing==2.4.0 -packaging==25.0 -pluggy==1.6.0 -protobuf==6.33.0 -py-cpuinfo==8.0.0 -pygments==2.19.2 -pytest==8.4.2 -pytest-asyncio==0.21.1 -pytest-benchmark==5.2.1 -pytest-cov==7.0.0 -pytest-mock==3.15.1 -pytest-randomly==4.0.1 -sortedcontainers==2.4.0 -tomli==2.3.0 -typing-extensions==4.15.0 -uwsgi==2.0.31 -zstandard==0.25.0 diff --git a/.riot/requirements/3c0f573.txt b/.riot/requirements/3c0f573.txt deleted file mode 100644 index fb0db0675f4..00000000000 --- a/.riot/requirements/3c0f573.txt +++ /dev/null @@ -1,37 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.10 -# by the following command: -# -# pip-compile --allow-unsafe --no-annotate .riot/requirements/3c0f573.in -# -attrs==25.4.0 -coverage[toml]==7.11.0 -exceptiongroup==1.3.0 -gevent==25.9.1 -greenlet==3.2.4 -gunicorn[gevent]==23.0.0 -hypothesis==6.45.0 -iniconfig==2.3.0 -mock==5.2.0 -opentracing==2.4.0 -packaging==25.0 -pluggy==1.6.0 -protobuf==6.33.0 -py-cpuinfo==8.0.0 -pygments==2.19.2 -pytest==8.4.2 -pytest-asyncio==0.21.1 -pytest-benchmark==5.2.1 -pytest-cov==7.0.0 -pytest-mock==3.15.1 -pytest-randomly==4.0.1 -sortedcontainers==2.4.0 -tomli==2.3.0 -typing-extensions==4.15.0 -uwsgi==2.0.31 -zope-event==6.0 -zope-interface==8.0.1 -zstandard==0.25.0 - -# The following packages are considered to be unsafe in a requirements file: -setuptools==80.9.0 diff --git a/.riot/requirements/57ce041.txt b/.riot/requirements/57ce041.txt deleted file mode 100644 index 2debe686006..00000000000 --- a/.riot/requirements/57ce041.txt +++ /dev/null @@ -1,27 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.11 -# by the following command: -# -# pip-compile --allow-unsafe --no-annotate .riot/requirements/57ce041.in -# -attrs==25.4.0 -coverage[toml]==7.11.0 -gunicorn==23.0.0 -hypothesis==6.45.0 -iniconfig==2.3.0 -mock==5.2.0 -opentracing==2.4.0 -packaging==25.0 -pluggy==1.6.0 -protobuf==4.22.0 -py-cpuinfo==8.0.0 -pygments==2.19.2 -pytest==8.4.2 -pytest-asyncio==0.21.1 -pytest-benchmark==5.2.1 -pytest-cov==7.0.0 -pytest-mock==3.15.1 -pytest-randomly==4.0.1 -sortedcontainers==2.4.0 -uwsgi==2.0.31 -zstandard==0.25.0 diff --git a/.riot/requirements/6f7b1a1.txt b/.riot/requirements/6f7b1a1.txt deleted file mode 100644 index a22644251aa..00000000000 --- a/.riot/requirements/6f7b1a1.txt +++ /dev/null @@ -1,37 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.10 -# by the following command: -# -# pip-compile --allow-unsafe --no-annotate .riot/requirements/6f7b1a1.in -# -attrs==25.4.0 -coverage[toml]==7.11.0 -exceptiongroup==1.3.0 -gevent==25.9.1 -greenlet==3.2.4 -gunicorn[gevent]==23.0.0 -hypothesis==6.45.0 -iniconfig==2.3.0 -mock==5.2.0 -opentracing==2.4.0 -packaging==25.0 -pluggy==1.6.0 -protobuf==6.33.0 -py-cpuinfo==8.0.0 -pygments==2.19.2 -pytest==8.4.2 -pytest-asyncio==0.21.1 -pytest-benchmark==5.2.1 -pytest-cov==7.0.0 -pytest-mock==3.15.1 -pytest-randomly==4.0.1 -sortedcontainers==2.4.0 -tomli==2.3.0 -typing-extensions==4.15.0 -uwsgi==2.0.31 -zope-event==6.0 -zope-interface==8.0.1 -zstandard==0.25.0 - -# The following packages are considered to be unsafe in a requirements file: -setuptools==80.9.0 diff --git a/.riot/requirements/768e5b9.txt b/.riot/requirements/768e5b9.txt deleted file mode 100644 index 23ad150ce63..00000000000 --- a/.riot/requirements/768e5b9.txt +++ /dev/null @@ -1,27 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# pip-compile --allow-unsafe --no-annotate .riot/requirements/768e5b9.in -# -attrs==25.4.0 -coverage[toml]==7.11.0 -gunicorn==23.0.0 -hypothesis==6.45.0 -iniconfig==2.3.0 -mock==5.2.0 -opentracing==2.4.0 -packaging==25.0 -pluggy==1.6.0 -protobuf==6.33.0 -py-cpuinfo==8.0.0 -pygments==2.19.2 -pytest==8.4.2 -pytest-asyncio==0.21.1 -pytest-benchmark==5.2.1 -pytest-cov==7.0.0 -pytest-mock==3.15.1 -pytest-randomly==4.0.1 -sortedcontainers==2.4.0 -uwsgi==2.0.31 -zstandard==0.25.0 diff --git a/.riot/requirements/7ab50e4.txt b/.riot/requirements/7ab50e4.txt deleted file mode 100644 index 6db2d9d7cd9..00000000000 --- a/.riot/requirements/7ab50e4.txt +++ /dev/null @@ -1,39 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.9 -# by the following command: -# -# pip-compile --allow-unsafe --no-annotate .riot/requirements/7ab50e4.in -# -attrs==25.4.0 -coverage[toml]==7.10.7 -exceptiongroup==1.3.0 -gevent==22.10.2 -greenlet==3.2.4 -gunicorn[gevent]==23.0.0 -hypothesis==6.45.0 -importlib-metadata==8.7.0 -iniconfig==2.1.0 -mock==5.2.0 -opentracing==2.4.0 -packaging==25.0 -pluggy==1.6.0 -protobuf==6.33.0 -py-cpuinfo==8.0.0 -pygments==2.19.2 -pytest==8.4.2 -pytest-asyncio==0.21.1 -pytest-benchmark==5.2.1 -pytest-cov==7.0.0 -pytest-mock==3.15.1 -pytest-randomly==4.0.1 -sortedcontainers==2.4.0 -tomli==2.3.0 -typing-extensions==4.15.0 -uwsgi==2.0.31 -zipp==3.23.0 -zope-event==6.0 -zope-interface==8.0.1 -zstandard==0.25.0 - -# The following packages are considered to be unsafe in a requirements file: -setuptools==80.9.0 diff --git a/.riot/requirements/83c892b.txt b/.riot/requirements/83c892b.txt deleted file mode 100644 index 9728e45e7fc..00000000000 --- a/.riot/requirements/83c892b.txt +++ /dev/null @@ -1,34 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# pip-compile --allow-unsafe --no-annotate .riot/requirements/83c892b.in -# -attrs==25.4.0 -coverage[toml]==7.11.0 -gevent==25.9.1 -greenlet==3.2.4 -gunicorn[gevent]==23.0.0 -hypothesis==6.45.0 -iniconfig==2.3.0 -mock==5.2.0 -opentracing==2.4.0 -packaging==25.0 -pluggy==1.6.0 -protobuf==6.33.0 -py-cpuinfo==8.0.0 -pygments==2.19.2 -pytest==8.4.2 -pytest-asyncio==0.21.1 -pytest-benchmark==5.2.1 -pytest-cov==7.0.0 -pytest-mock==3.15.1 -pytest-randomly==4.0.1 -sortedcontainers==2.4.0 -uwsgi==2.0.31 -zope-event==6.0 -zope-interface==8.0.1 -zstandard==0.25.0 - -# The following packages are considered to be unsafe in a requirements file: -setuptools==80.9.0 diff --git a/riotfile.py b/riotfile.py index 68051f51d50..ce6cfd97c3d 100644 --- a/riotfile.py +++ b/riotfile.py @@ -3226,106 +3226,6 @@ def select_pys(min_version: str = MIN_PYTHON_VERSION, max_version: str = MAX_PYT }, pys=select_pys(), ), - Venv( - name="profile", - # NB riot commands that use this Venv must include --pass-env to work properly - command="python -m tests.profiling.run pytest -v --no-cov --capture=no --benchmark-disable {cmdargs} tests/profiling", # noqa: E501 - env={ - "DD_PROFILING_ENABLE_ASSERTS": "1", - "DD_PROFILING_STACK_V2_ENABLED": "0", - "CPUCOUNT": "12", - # TODO: Remove once pkg_resources warnings are no longer emitted from this internal module - "PYTHONWARNINGS": "ignore::UserWarning:ddtrace.internal.module,ignore::UserWarning:gevent.events", - }, - pkgs={ - "gunicorn": latest, - "zstandard": latest, - # - # pytest-benchmark depends on cpuinfo which dropped support for Python<=3.6 in 9.0 - # See https://github.com/workhorsy/py-cpuinfo/issues/177 - "pytest-benchmark": latest, - "py-cpuinfo": "~=8.0.0", - "pytest-asyncio": "==0.21.1", - "pytest-randomly": latest, - }, - venvs=[ - Venv( - pys="3.9", - pkgs={"uwsgi": latest}, - venvs=[ - Venv( - pkgs={ - "protobuf": [">3", latest], - }, - ), - # Gevent - Venv( - env={ - "DD_PROFILE_TEST_GEVENT": "1", - }, - pkgs={ - "gunicorn[gevent]": latest, - "gevent": latest, - "protobuf": latest, - }, - ), - ], - ), - # Python 3.10 - Venv( - pys="3.10", - pkgs={"uwsgi": latest}, - venvs=[ - Venv( - pkgs={ - "protobuf": [">3", latest], - }, - ), - # Gevent - Venv( - env={ - "DD_PROFILE_TEST_GEVENT": "1", - }, - pkgs={ - "gunicorn[gevent]": latest, - "protobuf": latest, - }, - venvs=[ - Venv( - pkgs={ - "gevent": latest, - "greenlet": latest, - "protobuf": latest, - } - ), - Venv( - pkgs={"gevent": latest, "protobuf": latest}, - ), - ], - ), - ], - ), - # Python >= 3.11 - Venv( - pys=select_pys("3.11", "3.13"), - pkgs={"uwsgi": latest}, - venvs=[ - Venv( - pkgs={ - "protobuf": ["==4.22.0", latest], - }, - ), - # Gevent - Venv( - env={ - "DD_PROFILE_TEST_GEVENT": "1", - }, - pkgs={"gunicorn[gevent]": latest, "gevent": latest, "protobuf": latest}, - ), - ], - ), - ], - ), Venv( name="profile-v2", # NB riot commands that use this Venv must include --pass-env to work properly diff --git a/tests/profiling/suitespec.yml b/tests/profiling/suitespec.yml index 27251d5230b..51eb1cfe636 100644 --- a/tests/profiling/suitespec.yml +++ b/tests/profiling/suitespec.yml @@ -78,19 +78,6 @@ components: - ddtrace/commands/* - ddtrace/auto.py suites: - profile: - env: - DD_TRACE_AGENT_URL: '' - # `riot list --hash-only profile$ | wc -1` = 19 - parallelism: 16 - paths: - - '@bootstrap' - - '@core' - - '@profiling' - - tests/profiling/* - pattern: profile$ - retry: 2 - runner: riot profile_v2: env: DD_TRACE_AGENT_URL: '' From 4f8c7ce9be570c5e8fb727410226bfe0733a4055 Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Tue, 11 Nov 2025 13:20:26 -0500 Subject: [PATCH 6/7] update --- scripts/needs_testrun.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/needs_testrun.py b/scripts/needs_testrun.py index 0ee09cc7631..c168f843e9c 100755 --- a/scripts/needs_testrun.py +++ b/scripts/needs_testrun.py @@ -151,7 +151,7 @@ def needs_testrun(suite: str, pr_number: int, sha: t.Optional[str] = None) -> bo ... needs_testrun("debugger", 6485) ... needs_testrun("debugger", 6388) ... needs_testrun("foobar", 6412) - ... needs_testrun("profiling::profile", 11690) + ... needs_testrun("profiling::profile_v2", 11690) True True True From c9c3a24c86af6086af96a2b0a84484d36507539f Mon Sep 17 00:00:00 2001 From: Taegyun Kim Date: Tue, 11 Nov 2025 13:34:53 -0500 Subject: [PATCH 7/7] update suitespec check --- scripts/check_suitespec_coverage.py | 4 ++++ tests/profiling/_wrong_file | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) delete mode 100644 tests/profiling/_wrong_file diff --git a/scripts/check_suitespec_coverage.py b/scripts/check_suitespec_coverage.py index b1673cd50c7..e2ad4fa28c4 100755 --- a/scripts/check_suitespec_coverage.py +++ b/scripts/check_suitespec_coverage.py @@ -26,6 +26,10 @@ IGNORE_PATTERNS.add("**/*.md") # The aioredis integration is deprecated and untested IGNORE_PATTERNS.add("ddtrace/contrib/aioredis/*") +# TODO(taegyunkim): remove these after merging profiling v2 tests back to profiling +IGNORE_PATTERNS.add("tests/profiling/*.py") +IGNORE_PATTERNS.add("tests/profiling/*/*.py") +IGNORE_PATTERNS.add("tests/profiling/*/*.proto") def owners(path: str) -> str: diff --git a/tests/profiling/_wrong_file b/tests/profiling/_wrong_file deleted file mode 100644 index c1c2fc2dab2..00000000000 --- a/tests/profiling/_wrong_file +++ /dev/null @@ -1 +0,0 @@ -this is definitely not good python, right?