Skip to content

Enable Memory & CPU Profiling for df_engine#2420

Merged
jmacd merged 52 commits intoopen-telemetry:mainfrom
sapatrjv:dev/sapatr/memprofilingwithdhat
Apr 15, 2026
Merged

Enable Memory & CPU Profiling for df_engine#2420
jmacd merged 52 commits intoopen-telemetry:mainfrom
sapatrjv:dev/sapatr/memprofilingwithdhat

Conversation

@sapatrjv
Copy link
Copy Markdown
Contributor

@sapatrjv sapatrjv commented Mar 24, 2026

Change Summary

PR to enable CPU & Memory profiling for df_engine.

What issue does this PR close?

Fixes #2296
Fixes #2297
Fixes #2298
Fixes #2299

:)

How are these changes tested?

Are there any user-facing changes?

N/A

@sapatrjv sapatrjv requested a review from a team as a code owner March 24, 2026 04:49
@github-actions github-actions Bot added the rust Pull requests that update Rust code label Mar 24, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 0% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.10%. Comparing base (baac519) to head (7d2a092).
⚠️ Report is 2 commits behind head on main.

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2420      +/-   ##
==========================================
- Coverage   88.10%   88.10%   -0.01%     
==========================================
  Files         633      633              
  Lines      237176   237191      +15     
==========================================
- Hits       208975   208967       -8     
- Misses      27677    27700      +23     
  Partials      524      524              
Components Coverage Δ
otap-dataflow 89.78% <0.00%> (-0.02%) ⬇️
query_abstraction 80.61% <ø> (ø)
query_engine 90.72% <ø> (ø)
otel-arrow-go 52.45% <ø> (ø)
quiver 92.27% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread rust/otap-dataflow/src/main.rs Outdated
Comment thread rust/otap-dataflow/Cargo.toml Outdated
sysinfo.workspace = true
dhat = "0.3.3"
ctrlc = "3"
once_cell = "1"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could of points here

  • These 3 crates should be optional and enabled only when dhat-heap feature is enabled.
  • Since this crate already targets Rust 1.87, could we use std::sync::LazyLock here instead of adding once_cell just for this static?

@cijothomas
Copy link
Copy Markdown
Member

Does this closes the issue #2304 ?

@lalitb
Copy link
Copy Markdown
Member

lalitb commented Mar 25, 2026

Does this closes the issue #2304 ?

I don’t think this closes #2304. That issue is about One-Collect support for profiling other processes, while this PR seems focused on CPU/memory profiling for df_engine itself.

@jmacd
Copy link
Copy Markdown
Contributor

jmacd commented Mar 25, 2026

The issue this fixes: #2297. I modified the PR description.

Comment thread rust/otap-dataflow/src/main.rs Outdated
Comment thread rust/otap-dataflow/src/main.rs Outdated
Copy link
Copy Markdown
Contributor

@lquerel lquerel left a comment

Choose a reason for hiding this comment

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

I think there's a piece of code that needs to be put back, and a potential follow-up PR to track in a GitHub issue.

Comment thread rust/otap-dataflow/src/main.rs
Comment thread rust/otap-dataflow/src/main.rs Outdated
Comment thread rust/otap-dataflow/PROFILING.md

> [!NOTE]
> In this command, all default features are disabled.
> Use specific flags to enable individual features.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
> Use specific flags to enable individual features.
Use specific flags to enable individual features.

Copy link
Copy Markdown
Contributor Author

@sapatrjv sapatrjv Apr 3, 2026

Choose a reason for hiding this comment

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

In README,md file similar format usage is there. Here is an example.

Example:

Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Here is the rendered output:

Image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@sapatrjv which one should we use?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copilot response on it:

Image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copilot response on it:

and what's your take?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In my opinion, both approaches will work in this scenario. It will differ when a sentence needs to appear on a separate line. In this case add a blank line with > and then include the next sentence.

Comment thread rust/otap-dataflow/PROFILING.md
@jmacd jmacd enabled auto-merge April 3, 2026 15:52
@jmacd
Copy link
Copy Markdown
Contributor

jmacd commented Apr 3, 2026

I had to approve the workflows. @sapatrjv, please accept the invitation that was sent after open-telemetry/community#3352.

auto-merge was automatically disabled April 3, 2026 17:51

Head branch was pushed to by a user without write access

@jmacd jmacd enabled auto-merge April 3, 2026 19:54
@jmacd jmacd marked this pull request as draft April 9, 2026 16:03
auto-merge was automatically disabled April 9, 2026 16:03

Pull request was converted to draft


> [!NOTE]
> `dhat` needs a clean shutdown to generate `dhat-heap.json` file.
> In `df_engine` this can be done manually with Ctrl+C.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

does Ctrl+C do a clean shutdown? The engine is not yet configured to react to it...

Copy link
Copy Markdown
Contributor Author

@sapatrjv sapatrjv Apr 15, 2026

Choose a reason for hiding this comment

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

It does not handle clean shutdown with Ctrl+C. Here is PR #2325 that you own to handle it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Until that PR (or another PR which adds this) is merged, lets not mention that engine can do clean shutdown with Ctrl+C

@jmacd jmacd marked this pull request as ready for review April 15, 2026 16:42
@jmacd jmacd added this pull request to the merge queue Apr 15, 2026
Merged via the queue into open-telemetry:main with commit 60ceaa2 Apr 15, 2026
76 of 79 checks passed
github-merge-queue Bot pushed a commit that referenced this pull request Apr 17, 2026
…default malloc selection (#2695)

# Change Summary

Enables clippy in the conditional for Jemalloc in src/main.rs, with
@sapatrjv.

## What issue does this PR close?

Introduced in #2420.

Adds `--all-features --workspace -- -D warnings` to the clippy step in
`cargo xtask check`.

https://cloud-native.slack.com/archives/C08RRSJR7FD/p1776408892537689

## How are these changes tested?

Ran `cargo xtask clippy` on Ubuntu, not sure this actually works in
Windows.

## Are there any user-facing changes?

No
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust Pull requests that update Rust code

Projects

Status: Done

7 participants