Skip to content

feat(profiling): gevent support #13290

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 15 commits into from
Jun 11, 2025
Merged

feat(profiling): gevent support #13290

merged 15 commits into from
Jun 11, 2025

Conversation

P403n1x87
Copy link
Contributor

@P403n1x87 P403n1x87 commented Apr 29, 2025

We add support for gevent in stack-v2. We also improve CPU time accounting for async tasks in general.

This PR also upgrades Echion version we use.

Checklist

  • PR author has checked that all the criteria below are met
  • The PR description includes an overview of the change
  • The PR description articulates the motivation for the change
  • The change includes tests OR the PR description describes a testing strategy
  • The PR description notes risks associated with the change, if any
  • Newly-added code is easy to change
  • The change follows the library release note guidelines
  • The change includes or references documentation updates if necessary
  • Backport labels are set (if applicable)

Reviewer Checklist

  • Reviewer has checked that all the criteria below are met
  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Newly-added code is easy to change
  • Release note makes sense to a user of the library
  • If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy

@P403n1x87 P403n1x87 added the Profiling Continous Profling label Apr 29, 2025
Copy link
Contributor

github-actions bot commented Apr 29, 2025

CODEOWNERS have been resolved as:

ddtrace/profiling/_gevent.py                                            @DataDog/profiling-python
releasenotes/notes/profiling-gevent-support-4d13a9f437a02a27.yaml       @DataDog/apm-python
ddtrace/internal/datadog/profiling/stack_v2/CMakeLists.txt              @DataDog/profiling-python
ddtrace/internal/datadog/profiling/stack_v2/include/sampler.hpp         @DataDog/profiling-python
ddtrace/internal/datadog/profiling/stack_v2/include/stack_renderer.hpp  @DataDog/profiling-python
ddtrace/internal/datadog/profiling/stack_v2/src/sampler.cpp             @DataDog/profiling-python
ddtrace/internal/datadog/profiling/stack_v2/src/stack_renderer.cpp      @DataDog/profiling-python
ddtrace/internal/datadog/profiling/stack_v2/src/stack_v2.cpp            @DataDog/profiling-python
ddtrace/profiling/collector/_task.pyx                                   @DataDog/profiling-python
ddtrace/profiling/collector/threading.py                                @DataDog/profiling-python
pyproject.toml                                                          @DataDog/python-guild
tests/profiling/collector/test_task.py                                  @DataDog/profiling-python
tests/profiling_v2/collector/test_stack.py                              @DataDog/profiling-python
tests/profiling_v2/collector/test_threading.py                          @DataDog/profiling-python

Copy link
Contributor

github-actions bot commented Apr 29, 2025

Bootstrap import analysis

Comparison of import times between this PR and base.

Summary

The average import time from this PR is: 273 ± 2 ms.

The average import time from base is: 275 ± 2 ms.

The import time difference between this PR and base is: -2.27 ± 0.09 ms.

Import time breakdown

The following import paths have shrunk:

ddtrace.auto 2.032 ms (0.75%)
ddtrace.bootstrap.sitecustomize 1.354 ms (0.50%)
ddtrace.bootstrap.preload 1.354 ms (0.50%)
ddtrace.internal.remoteconfig.client 0.639 ms (0.23%)
ddtrace 0.678 ms (0.25%)
ddtrace.internal._unpatched 0.033 ms (0.01%)
json 0.033 ms (0.01%)
json.decoder 0.033 ms (0.01%)
re 0.033 ms (0.01%)
enum 0.033 ms (0.01%)
types 0.033 ms (0.01%)

@pr-commenter
Copy link

pr-commenter bot commented Apr 29, 2025

Benchmarks

Benchmark execution time: 2025-06-11 03:03:58

Comparing candidate commit d4ea756 in PR branch profiling/gevent-support with baseline commit df7393f in branch main.

Found 0 performance improvements and 1 performance regressions! Performance is the same for 560 metrics, 3 unstable metrics.

scenario:iastaspectsospath-ospathjoin_aspect

  • 🟥 execution_time [+849.839ns; +974.201ns] or [+13.895%; +15.929%]

@P403n1x87 P403n1x87 force-pushed the profiling/gevent-support branch from 9bdf029 to 162a670 Compare April 30, 2025 08:02
@P403n1x87 P403n1x87 force-pushed the profiling/gevent-support branch 2 times, most recently from 35ce314 to 3dfc46b Compare May 8, 2025 16:38
We add support for gevent in stack-v2.
@P403n1x87 P403n1x87 force-pushed the profiling/gevent-support branch from 3dfc46b to 7cde0f3 Compare May 8, 2025 16:48
@P403n1x87 P403n1x87 force-pushed the profiling/gevent-support branch from 0c383d2 to 35fba08 Compare May 9, 2025 12:36
@P403n1x87 P403n1x87 marked this pull request as ready for review May 9, 2025 12:37
@P403n1x87 P403n1x87 requested a review from a team as a code owner May 9, 2025 12:37
@P403n1x87 P403n1x87 enabled auto-merge (squash) May 9, 2025 12:37
@P403n1x87 P403n1x87 force-pushed the profiling/gevent-support branch from 94a6d74 to d709837 Compare May 9, 2025 13:45
@taegyunkim
Copy link
Contributor

oh yeah, I was about to mention that we'd need the legacy support for stack v1. We'll be able to remove so much code when stack v1 is removed!

@P403n1x87 P403n1x87 requested a review from a team as a code owner May 13, 2025 13:42
@P403n1x87 P403n1x87 requested a review from avara1986 May 13, 2025 13:42
@P403n1x87 P403n1x87 requested a review from a team as a code owner May 13, 2025 13:45
@P403n1x87 P403n1x87 requested a review from gnufede May 13, 2025 13:45
@taegyunkim taegyunkim force-pushed the profiling/gevent-support branch from 7c64cbd to fa81779 Compare June 9, 2025 18:28
@taegyunkim taegyunkim force-pushed the profiling/gevent-support branch from fa81779 to b8cacfd Compare June 9, 2025 18:31
@P403n1x87 P403n1x87 merged commit d2e32b9 into main Jun 11, 2025
884 of 888 checks passed
@P403n1x87 P403n1x87 deleted the profiling/gevent-support branch June 11, 2025 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Profiling Continous Profling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants