Skip to content

Conversation

@emmettbutler
Copy link
Collaborator

@emmettbutler emmettbutler commented Mar 21, 2025

This change addresses an issue in which Poetry running an app under a version of Python different from the one used to install Poetry causes library injection to fail. The approach is to ensure that the pythonpath doesn't contain anything related to ddtrace before adding new ddtrace-related entries to it.

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

@emmettbutler emmettbutler requested a review from a team as a code owner March 21, 2025 13:34
@github-actions
Copy link
Contributor

github-actions bot commented Mar 21, 2025

CODEOWNERS have been resolved as:

releasenotes/notes/clean-path-inject-42eb97e670d9ee67.yaml              @DataDog/apm-python
lib-injection/sources/sitecustomize.py                                  @DataDog/apm-core-python

@emmettbutler emmettbutler requested a review from a team as a code owner March 21, 2025 13:37
@github-actions
Copy link
Contributor

github-actions bot commented Mar 21, 2025

Bootstrap import analysis

Comparison of import times between this PR and main.

Summary

The average import time in this PR is: 238 ± 4 ms.

The average import time in main is: 239 ± 4 ms.

The import time difference between this PR and main is: -1.1 ± 0.2 ms.

Import time breakdown

The following import paths have shrunk:

ddtrace.auto 1.906 ms (0.80%)
ddtrace.bootstrap.sitecustomize 1.279 ms (0.54%)
ddtrace.bootstrap.preload 1.279 ms (0.54%)
ddtrace.internal.products 1.279 ms (0.54%)
ddtrace.internal.remoteconfig.client 0.624 ms (0.26%)
ddtrace 0.628 ms (0.26%)

@pr-commenter
Copy link

pr-commenter bot commented Mar 21, 2025

Benchmarks

Benchmark execution time: 2025-03-21 17:08:16

Comparing candidate commit 4c6c160 in PR branch emmett.butler/clean-path-inject with baseline commit 00c254b in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 498 metrics, 2 unstable metrics.

@emmettbutler emmettbutler requested a review from P403n1x87 March 21, 2025 16:20
@emmettbutler emmettbutler enabled auto-merge (squash) March 31, 2025 13:06
@emmettbutler emmettbutler merged commit cc7928e into main Mar 31, 2025
280 of 281 checks passed
@emmettbutler emmettbutler deleted the emmett.butler/clean-path-inject branch March 31, 2025 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants