Skip to content

Add CPU profiling integration with span correlation#95

Merged
johncarmack1984 merged 4 commits into
mainfrom
feature/profiling-integration
Jan 14, 2026
Merged

Add CPU profiling integration with span correlation#95
johncarmack1984 merged 4 commits into
mainfrom
feature/profiling-integration

Conversation

@johncarmack1984
Copy link
Copy Markdown
Collaborator

Summary

  • Add profiling feature flag that integrates with tauri-plugin-profiling for sampling-based CPU profiling
  • TracedProfilingExt trait for automatic span creation and logging around profiles
  • SpanTimingLayer for capturing span enter/exit timing during profiling
  • SpanAwareProfilingExt trait for correlating CPU samples with active tracing spans
  • Re-export profiling types (ProfileResult, ProfilingConfig, StartOptions, etc.)

Test plan

  • just check passes (157 tests, up from 149)
  • Doc tests compile with correct generate_context! paths
  • Integration tests cover SpanTimingLayer, SpanTimingCapture, and type exports
  • custom-subscriber example demonstrates span-aware CPU profiling

Adds `profiling` feature that integrates tauri-plugin-profiling with
tracing span correlation:

- TracedProfilingExt: wraps profiling with automatic spans and logging
- SpanTimingLayer: captures span enter/exit timing for correlation
- SpanAwareProfilingExt: CPU profiling with span correlation report
- SpanCorrelationReport: shows which spans were active during profiling

This enables correlating CPU samples with tracing spans to understand
which logical operations consume CPU time.
Demonstrates the profiling integration by adding:
- SpanTimingLayer setup for span timing capture
- run_profiled_work command showing SpanAwareProfilingExt usage
- Example instrumented functions with CPU-intensive work
- Update README with profiling feature in features list
- Add 8 integration tests for profiling types and SpanTimingLayer
- Fix doc examples to use correct generate_context path
- Fix doc examples to include use tauri::Manager
@github-actions
Copy link
Copy Markdown
Contributor

Package Changes Through d46e2a0

There are 2 changes which include tracing with minor, tracing-js with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
tracing 0.3.1 0.4.0
tracing-js 0.3.1 0.4.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@johncarmack1984 johncarmack1984 merged commit 97f668f into main Jan 14, 2026
8 checks passed
@johncarmack1984 johncarmack1984 deleted the feature/profiling-integration branch January 14, 2026 22:42
@github-actions github-actions Bot mentioned this pull request Jan 14, 2026
johncarmack1984 pushed a commit that referenced this pull request Jan 14, 2026
# Version Updates

Merging this PR will release new versions of the following packages
based on your change files.




# tracing

## [0.3.2]
- 97f668f (#95 by @johncarmack1984) Add CPU profiling integration with
span correlation via new `profiling` feature. Includes
`TracedProfilingExt` for automatic span/logging around profiles,
`SpanTimingLayer` for capturing span timing, and `SpanAwareProfilingExt`
for correlating CPU samples with active tracing spans.



# tracing-js

## [0.3.2]
- 97f668f (#95 by @johncarmack1984) Add CPU profiling integration with
span correlation via new `profiling` feature. Includes
`TracedProfilingExt` for automatic span/logging around profiles,
`SpanTimingLayer` for capturing span timing, and `SpanAwareProfilingExt`
for correlating CPU samples with active tracing spans.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

1 participant