Skip to content

Commit a346cdd

Browse files
authored
chore(lib-injection): change the print statements in sitecustomize.py to print to stderr (#6243)
Addresses issue that occurs when using ansible to install automatic host instrumentation. https://dd.slack.com/archives/C04V0MJL6MA/p1688050478969999 Testing strategy: - Will run through the ansible build process again, see if the errors go away Risks: None (these are debug statements that should have been written to stderr from the beginning) Maintenance: None Documentation: None ## Checklist - [X] Change(s) are motivated and described in the PR description. - [X] Testing strategy is described if automated tests are not included in the PR. - [X] Risk is outlined (performance impact, potential for breakage, maintainability, etc). - [X] Change is maintainable (easy to change, telemetry, documentation). - [X] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed. If no release note is required, add label `changelog/no-changelog`. - [X] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)). - [X] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Title is accurate. - [x] No unnecessary changes are introduced. - [x] Description motivates each change. - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes unless absolutely necessary. - [x] Testing strategy adequately addresses listed risk(s). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] Release note makes sense to a user of the library. - [x] Reviewer has explicitly acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment. - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)
1 parent fded2a1 commit a346cdd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib-injection/sitecustomize.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def _configure_ddtrace():
1616

1717
# Also insert the bootstrap dir in the path of the current python process.
1818
sys.path.insert(0, bootstrap_dir)
19-
print("datadog autoinstrumentation: successfully configured python package")
19+
print("datadog autoinstrumentation: successfully configured python package", file=sys.stderr)
2020

2121

2222
# Avoid infinite loop when attempting to install ddtrace. This flag is set when
@@ -28,7 +28,7 @@ def _configure_ddtrace():
2828
except ImportError:
2929
import subprocess
3030

31-
print("datadog autoinstrumentation: installing python package")
31+
print("datadog autoinstrumentation: installing python package", file=sys.stderr)
3232

3333
# Set the flag to avoid an infinite loop.
3434
env = os.environ.copy()
@@ -43,10 +43,10 @@ def _configure_ddtrace():
4343
check=True,
4444
)
4545
except BaseException as e:
46-
print("datadog autoinstrumentation: failed to install python package %s" % str(e))
46+
print("datadog autoinstrumentation: failed to install python package %s" % str(e), file=sys.stderr)
4747
else:
48-
print("datadog autoinstrumentation: successfully installed python package")
48+
print("datadog autoinstrumentation: successfully installed python package", file=sys.stderr)
4949
_configure_ddtrace()
5050
else:
51-
print("datadog autoinstrumentation: ddtrace already installed, skipping install")
51+
print("datadog autoinstrumentation: ddtrace already installed, skipping install", file=sys.stderr)
5252
_configure_ddtrace()

0 commit comments

Comments
 (0)