dd-trace-py
dd-trace-py copied to clipboard
chore(tracing): remove unnecessary setting
enabled is not a parameter of tracer._recreate(...). This function should not have the hidden side-effect of enabling/disabling the tracer.
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
CODEOWNERS have been resolved as:
ddtrace/_trace/tracer.py @DataDog/apm-sdk-api-python
ddtrace/internal/ci_visibility/recorder.py @DataDog/ci-app-libraries
Bootstrap import analysis
Comparison of import times between this PR and base.
Summary
The average import time from this PR is: 287 ± 2 ms.
The average import time from base is: 288 ± 2 ms.
The import time difference between this PR and base is: -0.92 ± 0.1 ms.
Import time breakdown
The following import paths have shrunk:
ddtrace.auto
1.911 ms
(0.67%)
ddtrace.bootstrap.sitecustomize
1.235 ms
(0.43%)
ddtrace.bootstrap.preload
1.235 ms
(0.43%)
ddtrace.internal.remoteconfig.client
0.620 ms
(0.22%)
ddtrace
0.676 ms
(0.24%)
ddtrace.internal._unpatched
0.029 ms
(0.01%)
json
0.029 ms
(0.01%)
json.decoder
0.029 ms
(0.01%)
re
0.029 ms
(0.01%)
enum
0.029 ms
(0.01%)
types
0.029 ms
(0.01%)
Benchmarks
Benchmark execution time: 2025-07-11 17:36:46
Comparing candidate commit 334eb22f1f61db869eb95f7f4ab4148cb02b5bc6 in PR branch munir/remove-weird-tracing-enabled-side-effect with baseline commit ae34ecc49a7cca1aece492346910a56e1ad6421c in branch main.
Found 0 performance improvements and 2 performance regressions! Performance is the same for 546 metrics, 2 unstable metrics.
scenario:iastaspectsospath-ospathsplitext_aspect
- 🟥
execution_time[+744.281ns; +812.826ns] or [+16.192%; +17.683%]
scenario:telemetryaddmetric-1-distribution-metric-1-times
- 🟥
execution_time[+397.571ns; +429.790ns] or [+13.494%; +14.587%]