dd-trace-py icon indicating copy to clipboard operation
dd-trace-py copied to clipboard

feat(co): add in-product enablement support

Open P403n1x87 opened this issue 6 months ago • 4 comments

We add support for in-product enablement to code origin for spans.

Checklist

  • [x] 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

  • [x] 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 avatar Jun 10 '25 10:06 P403n1x87

CODEOWNERS have been resolved as:

releasenotes/notes/feat-co-in-product-enablement-6b70fc52d62721fa.yaml  @DataDog/apm-python
ddtrace/debugging/_products/code_origin/span.py                         @DataDog/debugger-python

github-actions[bot] avatar Jun 10 '25 10:06 github-actions[bot]

Bootstrap import analysis

Comparison of import times between this PR and base.

Summary

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

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

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

Import time breakdown

The following import paths have grown:

ddtrace.auto 0.679 ms (0.24%)
ddtrace.bootstrap.sitecustomize 0.679 ms (0.24%)
ddtrace.bootstrap.preload 0.626 ms (0.23%)
ddtrace.debugging._import 0.068 ms (0.02%)
ddtrace._trace.trace_handlers 0.053 ms (0.02%)

The following import paths have shrunk:

ddtrace.auto 1.525 ms (0.55%)
ddtrace.bootstrap.sitecustomize 0.852 ms (0.31%)
ddtrace.bootstrap.preload 0.728 ms (0.26%)
ddtrace.internal.remoteconfig.client 0.655 ms (0.24%)
ddtrace.debugging._import 0.073 ms (0.03%)
ddtrace.debugging._function.discovery 0.073 ms (0.03%)
ddtrace._trace.trace_handlers 0.039 ms (0.01%)
ddtrace._trace._inferred_proxy 0.039 ms (0.01%)
ddtrace 0.673 ms (0.24%)
ddtrace.internal._unpatched 0.030 ms (0.01%)
json 0.030 ms (0.01%)
json.decoder 0.030 ms (0.01%)
re 0.030 ms (0.01%)
enum 0.030 ms (0.01%)
types 0.030 ms (0.01%)

github-actions[bot] avatar Jun 10 '25 10:06 github-actions[bot]

Benchmarks

Benchmark execution time: 2025-07-07 10:38:20

Comparing candidate commit d861785a4d6691b7561d6dd23fab50aa27830866 in PR branch feat/co-in-product-enablement with baseline commit a8419a40fe9e73e0a84c4cab53094c384480a5a6 in branch main.

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

scenario:iastaspectsospath-ospathsplit_aspect

  • 🟥 execution_time [+915.183ns; +1061.981ns] or [+18.753%; +21.761%]

pr-commenter[bot] avatar Jun 10 '25 11:06 pr-commenter[bot]

I think in-product enablement should only enable entry spans so this might be blocked by https://github.com/DataDog/dd-trace-py/pull/13593.

tylfin avatar Jun 10 '25 11:06 tylfin