Skip to content

refactor(trace): enrich spans with dynamic context - #2613

Merged
max-sixty merged 1 commit into
mainfrom
trace-followups
May 5, 2026
Merged

max-sixty merged 1 commit into
mainfrom
trace-followups

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Follow-ups to #2554. The spans there used &'static str names, so the per-call context (which alias, which template) couldn't be attributed in wt-perf output.

  • Span::new now accepts impl Into<Cow<'static, str>> — string literals stay borrowed, dynamic names are owned. Removes the docs note "for dynamic names, call span_completed directly," which was a worse API (callers had to reproduce the RAII timing themselves).
  • Alias execution spans carry the alias name (try_alias:deploy, run_alias:deploy, prepare_steps:deploy).
  • template_render carries 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.
  • 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. Single source of truth for finished-command emission.

This was written by Claude Code on behalf of Maximilian.

- `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]>
@max-sixty
max-sixty merged commit 8054b68 into main May 5, 2026
26 of 27 checks passed
@max-sixty
max-sixty deleted the trace-followups branch May 5, 2026 01:26
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.

2 participants