Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tracing: Add --trace-json for visualising traces and add more spans #3327

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Bravo555
Copy link
Contributor

@Bravo555 Bravo555 commented Jan 13, 2025

TODO

  • remove some too verbose events
  • adjust span levels

Proposed changes

Add --trace-json option that when used causes a trace-TIMESTAMP.json file will be created which can be opened by tools like https://ui.perfetto.dev.

Also added more spans, particularly on the Actor::run method, so that we can easily see which actor emitted new span/event.

Example: Before new spans

Screenshot 2025-01-13 at 17-01-38 trace-1736783287825075 json (4 MB) - Perfetto UI

trace-1736783287825075.json

Example: After new spans

Screenshot 2025-01-13 at 17-06-58 trace-1736784244896393 json (7 MB) - Perfetto UI

trace-1736784244896393.json

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (general improvements like code refactoring that doesn't explicitly fix a bug or add any new functionality)
  • Documentation Update (if none of the other choices apply)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Paste Link to the issue


Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA (in all commits with git commit -s)
  • I ran cargo fmt as mentioned in CODING_GUIDELINES
  • I used cargo clippy as mentioned in CODING_GUIDELINES
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

Copy link

codecov bot commented Jan 13, 2025

Copy link
Contributor

@didier-wenzek didier-wenzek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR would deserve some clean-up to focus on its main ideas (better use of tracing spans and trace visualization using tracing-chrome).

I agree that tracing span is a powerful tool to improve thin-edge debug-ability. However, I need more evidence to be convinced by visual traces.
I think efforts need to be made elsewhere first, on what is traced and on the level of details.

This is to make diff smaller for the next commit that adds a chrome
layer that outputs a JSON trace file

Signed-off-by: Marcel Guzik <[email protected]>
If `--trace-json` option is used, a `trace-TIMESTAMP.json` file will be
created which can be opened by tools like ui.perfetto.dev

Signed-off-by: Marcel Guzik <[email protected]>
@Bravo555 Bravo555 force-pushed the improve/tracing-output-json branch from 6574b60 to 5f1e805 Compare January 23, 2025 09:55
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