chore(telemetry): use absolute imports in the telemetry writer #22407
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 210 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.320
Real PR Conversation Timeline
1 comments
"Review active on #22407"
general
weight: 0.35
juanjux
Description
ddtrace/internal/telemetry/writer.pyimportsatexit,excepthookandforksafewithfrom ...internal import .... That path climbs out ofddtrace/internal, so once the module is moved verbatim into_ddtrace_internal(DataDog/datadog-apm-python#77) the import fails at import time. This changes them tofrom ddtrace.internal import ..., which resolves to the same modules.I grepped
ddtrace/internalforfrom \.\.\.and found three more modules climbing aboveddtrace/internal; they get the same treatment:ddtrace/internal/datastreams/__init__.py:from ...internal.utils.importlib->from ddtrace.internal.utils.importlibddtrace/internal/runtime/tag_collectors.py:from ...constants->from ddtrace.constantsddtrace/internal/writer/writer.py:from ...constants->from ddtrace.constants(The two other matches are comments in
coverage/instrumentation_py3_.py.) Relative imports that stay insideddtrace/internalare left as they are.Testing
scripts/run-tests tests/telemetry/test_writer.py --venv 30f1fa3e38a8 -- -p no:randomly -k test_writer(py3.12, under the docker flock): 124 passed.rg 'from \.\.\.' ddtrace/internal: only the two comments above remain.scripts/import-analysis/cycles.py analyze: 0 cycles.ruff check,ruff format --check,scripts/lint typingon the 4 touched files: clean (commit hooks passed too).Risks
Low. Same target modules, only the spelling of the import changes. Import order within each file follows the repo's isort rules, which moved the absolute imports into the
ddtrace.group.🤖 Generated with Claude Code