Skip to content

chore(profiling): update Python profiling collectors for py3.15 - #18504

Closed
vlad-scherbich wants to merge 1 commit into
vlad/ddtracepy-315-profiling-nativefrom
vlad/ddtracepy-315-profiling-collectors
Closed

chore(profiling): update Python profiling collectors for py3.15#18504
vlad-scherbich wants to merge 1 commit into
vlad/ddtracepy-315-profiling-nativefrom
vlad/ddtracepy-315-profiling-collectors

Conversation

@vlad-scherbich

@vlad-scherbich vlad-scherbich commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

← Prev: #18503 | Next → #17624

PROF-14200

Description

Updates the Python profiling collectors for CPython 3.15 compatibility.

Collectors (threading.py, asyncio.py, exception.py, stack.py):

  • Guard private asyncio/threading APIs that were removed or moved in 3.15
    (_exception, _task, threading._lock imports gated on version checks)
  • _GatheringFuture.__init__ and _wait wrappers: guard current_task() call against
    RuntimeError when invoked outside a running event loop on 3.15+

_asyncio.py (minimal fix here; deep refactor is in #18389):

  • Guard get_running_loop() / current_task() calls that 3.15's implementation can sidestep

monitoring.py, asyncs.py: minor 3.15 compatibility guards.

Testing

CI: profile, profile-memalloc, crashtracker venvs on py3.15.

Risks

Low. All changes are version-gated guards; behavior on older Python is unchanged.

Additional Notes

Part of the Python 3.15 support stack. Relates to #17809.

@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 4 Pipeline jobs failed

Changelog | Validate changelog   View in Datadog   GitHub Actions

DataDog/apm-reliability/dd-trace-py | build_base_venvs: [3.15]   View in Datadog   GitLab

DataDog/apm-reliability/dd-trace-py | check-slo-breaches   View in Datadog   GitLab

View all 4 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 163c7da | Docs | Datadog PR Page | Give us feedback!

@pr-commenter

pr-commenter Bot commented Jun 8, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-06-08 13:21:24

Comparing candidate commit 163c7da in PR branch vlad/ddtracepy-315-profiling-collectors with baseline commit 6abf4b7 in branch vlad/ddtracepy-315-profiling-native.

Found 0 performance improvements and 5 performance regressions! Performance is the same for 613 metrics, 9 unstable metrics.

scenario:iastaspects-index_aspect

  • 🟥 execution_time [+8.899µs; +12.644µs] or [+7.244%; +10.293%]

scenario:iastaspects-stringio_aspect

  • 🟥 execution_time [+658.872µs; +719.435µs] or [+16.945%; +18.503%]

scenario:iastaspectsospath-ospathbasename_aspect

  • 🟥 execution_time [+100.428µs; +107.418µs] or [+23.471%; +25.105%]

scenario:span-start

  • 🟥 execution_time [+1.226ms; +1.362ms] or [+7.784%; +8.649%]

scenario:tracer-small

  • 🟥 execution_time [+25.573µs; +28.522µs] or [+7.308%; +8.151%]

@github-actions github-actions Bot added the stale label Jul 9, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed after a period of inactivity.
After this much time, it will likely be easier to open a new pull request with the
same changes than to update this one from the base branch. Please comment or reopen
if you think this pull request was closed in error.

@github-actions github-actions Bot closed this Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant