feat(core-node): Add allocation metrics to flamegraphs#9298
Merged
muXxer merged 21 commits intofeat/flamegraphsfrom Dec 12, 2025
Merged
feat(core-node): Add allocation metrics to flamegraphs#9298muXxer merged 21 commits intofeat/flamegraphsfrom
muXxer merged 21 commits intofeat/flamegraphsfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 6 Skipped Deployments
|
01d9447 to
4ad0481
Compare
b57f73d to
94b11f3
Compare
4ad0481 to
fc315be
Compare
94b11f3 to
ff496d9
Compare
ff496d9 to
fa7b808
Compare
piotrm50
approved these changes
Nov 21, 2025
Thoralf-M
reviewed
Nov 24, 2025
4 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds allocation tracking to flamegraphs by implementing a global allocator wrapper that counts allocation metrics (alloc, dealloc, peak) per thread. The feature uses the unstable thread_local attribute and is guarded behind the "flamegraph-alloc" feature flag.
Key Changes
- Implements a
CounterAllocwrapper around the global allocator to track per-thread allocation metrics - Refactors the SVG rendering code to support multiple measurement types (time or memory allocations)
- Integrates allocation tracking into the admin API with a new
memquery parameter - Adds support for custom Rust toolchains and cargo features in the AWS orchestrator
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/telemetry-subscribers/src/lib.rs | Adds feature gate for unstable thread_local feature |
| crates/telemetry-subscribers/src/flamegraph/alloc.rs | Implements allocator wrapper and per-thread metrics tracking |
| crates/telemetry-subscribers/src/flamegraph/metric.rs | Integrates allocation metrics into FlameMetric |
| crates/telemetry-subscribers/src/flamegraph/svg.rs | Refactors rendering to support multiple measure types (time/memory) |
| crates/telemetry-subscribers/src/flamegraph/callgraph.rs | Adds Default derive to Frame |
| crates/telemetry-subscribers/src/flamegraph.rs | Exports allocation types when feature is enabled |
| crates/telemetry-subscribers/Cargo.toml | Defines flamegraph-alloc feature |
| crates/iota-node/src/main.rs | Sets up global allocator when feature is enabled |
| crates/iota-node/src/admin.rs | Adds mem parameter to flamegraph API |
| crates/iota-node/Cargo.toml | Propagates feature flag to telemetry-subscribers |
| crates/iota-benchmark/src/bin/flamegraph.rs | Demonstrates usage of allocation tracking in benchmark |
| crates/iota-benchmark/Cargo.toml | Adds feature and required-features for flamegraph binary |
| crates/iota/src/iota_commands.rs | Adds CLI flag for default admin interface address |
| crates/iota-swarm-config/src/node_config_builder.rs | Supports configurable admin interface address |
| crates/iota-swarm-config/src/network_config_builder.rs | Supports default admin interface address in builder |
| crates/iota-aws-orchestrator/src/settings.rs | Adds rust_toolchain and node_features settings |
| crates/iota-aws-orchestrator/src/protocol/mod.rs | Adds nodes_flamegraph_command method |
| crates/iota-aws-orchestrator/src/protocol/iota.rs | Implements custom cargo commands with features |
| crates/iota-aws-orchestrator/src/orchestrator.rs | Fetches flamegraphs separately for time and memory metrics |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
muXxer
requested changes
Nov 29, 2025
9d2baf7 to
8ec76c5
Compare
19432d4 to
f00b0b9
Compare
4 tasks
muXxer
added a commit
that referenced
this pull request
Dec 3, 2025
#9495) # Description of change This PR adds a section to the `aws-orchestrator` settings to configure toolchain and features per binary. This is needed for the tests with the `flamegraph-alloc` flag that will be introduced by #9298 ## How the change has been tested - [x] Basic tests (linting, compilation, formatting, unit/integration tests) - [ ] Patch-specific tests (correctness, functionality coverage) - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have checked that new and existing unit tests pass locally with my changes
8ec76c5 to
45b9030
Compare
f00b0b9 to
fad0265
Compare
45b9030 to
c9a9901
Compare
c9a9901 to
8a2b37e
Compare
…oc' feature detected in build settings
46a024c to
226a71b
Compare
muXxer
approved these changes
Dec 11, 2025
2115a95 to
fa46dff
Compare
fa46dff to
5894b06
Compare
muXxer
added a commit
that referenced
this pull request
Dec 12, 2025
# Description of change This PR adds global allocator wrapper counting allocation metrics (alloc, dealloc, peak) per thread. It uses unstable feature `thread_local` (it's the only reasonable way, `thread_local!` macro can't be used) which is guarded behind feature `"flamegraph-alloc"`. The allocation stats are shown in rendered SVG. ## Links to any relevant issues Part of #8694. ## How the change has been tested - [x] Basic tests (linting, compilation, formatting, unit/integration tests) - [ ] Patch-specific tests (correctness, functionality coverage) - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have checked that new and existing unit tests pass locally with my changes ### Release Notes - [ ] Protocol: - [x] Nodes (Validators and Full nodes): Extend telemetry subscribers with allocations per thread metrics. - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --------- Co-authored-by: muXxer <git@muxxer.de>
muXxer
added a commit
that referenced
this pull request
Dec 12, 2025
This PR adds global allocator wrapper counting allocation metrics (alloc, dealloc, peak) per thread. It uses unstable feature `thread_local` (it's the only reasonable way, `thread_local!` macro can't be used) which is guarded behind feature `"flamegraph-alloc"`. The allocation stats are shown in rendered SVG. Part of #8694. - [x] Basic tests (linting, compilation, formatting, unit/integration tests) - [ ] Patch-specific tests (correctness, functionality coverage) - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have checked that new and existing unit tests pass locally with my changes - [ ] Protocol: - [x] Nodes (Validators and Full nodes): Extend telemetry subscribers with allocations per thread metrics. - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --------- Co-authored-by: muXxer <git@muxxer.de>
NaitsabesMue
pushed a commit
that referenced
this pull request
Dec 17, 2025
#9495) # Description of change This PR adds a section to the `aws-orchestrator` settings to configure toolchain and features per binary. This is needed for the tests with the `flamegraph-alloc` flag that will be introduced by #9298 ## How the change has been tested - [x] Basic tests (linting, compilation, formatting, unit/integration tests) - [ ] Patch-specific tests (correctness, functionality coverage) - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have checked that new and existing unit tests pass locally with my changes
NaitsabesMue
pushed a commit
that referenced
this pull request
Dec 17, 2025
This PR adds global allocator wrapper counting allocation metrics (alloc, dealloc, peak) per thread. It uses unstable feature `thread_local` (it's the only reasonable way, `thread_local!` macro can't be used) which is guarded behind feature `"flamegraph-alloc"`. The allocation stats are shown in rendered SVG. Part of #8694. - [x] Basic tests (linting, compilation, formatting, unit/integration tests) - [ ] Patch-specific tests (correctness, functionality coverage) - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have checked that new and existing unit tests pass locally with my changes - [ ] Protocol: - [x] Nodes (Validators and Full nodes): Extend telemetry subscribers with allocations per thread metrics. - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --------- Co-authored-by: muXxer <git@muxxer.de>
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.
Description of change
This PR adds global allocator wrapper counting allocation metrics (alloc, dealloc, peak) per thread. It uses unstable feature
thread_local(it's the only reasonable way,thread_local!macro can't be used) which is guarded behind feature"flamegraph-alloc". The allocation stats are shown in rendered SVG.Links to any relevant issues
Part of #8694.
How the change has been tested
Release Notes