nativelink
nativelink copied to clipboard
Span tracing
Description
Adding feature to enable/disable builds of nativelink to include trace spans.
Trace spans can be use for instrumenting historical call paths of the tokio workers. Implementation provided shunts enabling/disabling at the cfg/features flags level. Enabling this feature would have performance runtime impact and should be used in debugging/introspection scenarios. Applying the instrumentation updates the source tree and not expected to be checked in (atm). The span format uses chrome tracing json and can be viewed in chrome://tracing
(or https://ui.perfetto.dev/). Trace snapshots are collected upon sever exit.
Output traces upon server exit are dumped in the cwd of the nativelink bin in the format trace-*.json
Example
# Apply instrumentation
./tools/patch_tracing.sh fix
# Build/Run
RUST_LOG=INFO cargo --config 'build.rustflags=["--cfg", "tokio_unstable", "--cfg", "enable_tracing"]' run --features enable_tokio_console,enable_tracing -- nativelink-config/examples/basic_cas.json
# Unapply instrumentation
./tools/patch_tracing.sh strip
Open Questions
Should trace snapshots be collected upon server exit, client requests or external signal to admin ports?
Should clippy-tracing
be a preinstalled expectation or configured/added in nix?
Should we checkin the tracing macro and create linting that auto lints (fix) the source tree when instrumentation is missing?
Fixes # (issue)
Type of change
Please delete options that are not relevant.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
How Has This Been Tested?
Please also list any relevant details for your test configuration
Checklist
- [ ] Updated documentation if needed
- [ ] Tests added/amended
- [ ]
bazel test //...
passes locally - [ ] PR is contained in a single commit, using
git amend
see some docs
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
nativelink-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jan 10, 2024 9:14pm |