Repository navigation
refactor(trace): enrich spans with dynamic context - #2613
Merged
Merged
Conversation
- `Span::new` now accepts `impl Into<Cow<'static, str>>`, so spans can carry dynamic names (e.g. `run_alias:deploy`) without dropping to the lower-level `span_completed` API. - Alias execution spans now include the alias name (`try_alias`, `run_alias`, `prepare_steps`) so `wt-perf` can attribute time per alias instead of lumping them together. - `template_render` spans now include the command label, and the concurrent-group span moved inside the per-command map so each render emits its own record. - Consolidated `Cmd::run` / `Cmd::pipe_into` trace emission behind `WtTraceLog::record_result`, removing the duplicated `t0/ts/tid` capture and the free `log_command_result` helper. Co-Authored-By: Claude <[email protected]>
worktrunk-bot
approved these changes
May 5, 2026
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.
Follow-ups to #2554. The spans there used
&'static strnames, so the per-call context (which alias, which template) couldn't be attributed inwt-perfoutput.Span::newnow acceptsimpl Into<Cow<'static, str>>— string literals stay borrowed, dynamic names are owned. Removes the docs note "for dynamic names, callspan_completeddirectly," which was a worse API (callers had to reproduce the RAII timing themselves).try_alias:deploy,run_alias:deploy,prepare_steps:deploy).template_rendercarries the command label, and the concurrent-group span moved inside the per-command map so each render emits its own record instead of one outer record covering all of them.Cmd::run/Cmd::pipe_intotrace emission behindWtTraceLog::record_result, removing the duplicatedt0/ts/tidcapture and the freelog_command_resulthelper. Single source of truth for finished-command emission.