feat(weave): migrate remaining 10 files to @traced (PR-7b2)#7202
Draft
amwarrier wants to merge 1 commit into
Draft
feat(weave): migrate remaining 10 files to @traced (PR-7b2)#7202amwarrier wants to merge 1 commit into
amwarrier wants to merge 1 commit into
Conversation
f3bceb9 to
213dfe7
Compare
Stacked on PR-7b1. Removes ddtrace from the rest of weave/trace_server/ except datadog.py (PR-7c). Covers: - 17 @ddtrace.tracer.wrap -> @Traced - 2 with ddtrace.tracer.trace(...) blocks -> _tracer.start_as_current_span(...) - 3 span.set_tag/set_tags -> set_attribute/set_attributes (inside migrated blocks) - 1 ddtrace.tracer.current_root_span() -> trace.get_current_span() (with `if root_span.is_recording():` check, since get_current_span() returns a no-op span rather than None when no span is active) Files touched: - weave/trace_server/base64_content_conversion.py (1 wrap) - weave/trace_server/clickhouse/utilities.py (1 wrap) - weave/trace_server/eval_results_helpers.py (6 wraps) - weave/trace_server/kafka.py (1 wrap) - weave/trace_server/parallel_bucket_uploads.py (1 wrap) - weave/trace_server/project_version/clickhouse_project_version.py (1 wrap + current_root_span) - weave/trace_server/project_version/project_version.py (1 trace block) - weave/trace_server/ttl_settings.py (1 wrap + 1 trace block + 3 set_tag) - weave/trace_server/usage_utils.py (1 wrap) - weave/trace_server/workers/evaluate_model_worker/evaluate_model_worker.py (4 wraps) After this PR, the only remaining `import ddtrace` is in weave/trace_server/datadog.py, which PR-7c rewrites + finally removes the ddtrace dep from pyproject.toml. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
6036a72 to
d54aad8
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
amwarrier
added a commit
that referenced
this pull request
Jun 12, 2026
…ated) Integrated commit for testing in wandb/core's weave-trace image on wandbench-small. Represents the combined effect of upstream PRs: - #7196 (PR-7a): @Traced + @traced_generator in weave/trace_server/tracing.py - #7201 (PR-7b1): 47 wraps in clickhouse_trace_server_batched.py - #7202 (PR-7b2): 17 wraps + 2 trace blocks + 3 set_tag + 1 current_root in 10 files - #7203 (PR-7c): inline DogStatsD in datadog.py, drop ddtrace dep from pyproject.toml This branch sits on top of the wandb/core-pinned submodule SHA so the weave-trace image build picks up only PR-7 changes — no unrelated upstream drift. After this commit, `grep -rn "import ddtrace\|from ddtrace"` returns empty across weave/trace_server/. Only docstring/comment references remain. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on PR-7b1. Sub-PR 3 of 4 in the migration.
Removes ddtrace from the remaining 10 files in
weave/trace_server/(everything exceptdatadog.py, which PR-7c handles).Changes
@ddtrace.tracer.wrap→@tracedwith ddtrace.tracer.trace(...)blocks →_tracer.start_as_current_span(...)span.set_tag/set_tags→set_attribute/set_attributesddtrace.tracer.current_root_span()→trace.get_current_span(), withif root_span.is_recording():check (sinceget_current_span()returns a no-op span rather than None when no span is active)import ddtracestatements removedFiles touched
base64_content_conversion.pyclickhouse/utilities.pyeval_results_helpers.pykafka.pyparallel_bucket_uploads.pyproject_version/clickhouse_project_version.pyproject_version/project_version.pyttl_settings.pyusage_utils.pyworkers/evaluate_model_worker/evaluate_model_worker.pyAfter this PR
The only remaining
import ddtracein the repo is insideweave/trace_server/datadog.py, which PR-7c rewrites + drops the dep frompyproject.toml.🤖 Generated with Claude Code