Skip to content

feat(server): Add on-demand heap profiling endpoints#522

Open
jan-auer wants to merge 3 commits into
mainfrom
build/profiling
Open

feat(server): Add on-demand heap profiling endpoints#522
jan-auer wants to merge 3 commits into
mainfrom
build/profiling

Conversation

@jan-auer

@jan-auer jan-auer commented Jun 25, 2026

Copy link
Copy Markdown
Member

Adds gated heap profiling to production builds using jemalloc's built-in sampling. Profiling is compiled in via a new profiling Cargo feature (enabled in release/CI builds, off for debug) and dormant at startup. It can be activated on demand via HTTP endpoints, which dump a symbolized gzipped pprof profile.

  • Outputs symbolized pprof, so profiles are self-contained and analyzable with go tool pprof without shipping the binary separately.
  • Endpoints are loopback-only (peer IP check), reachable via kubectl port-forward or an ephemeral debug container. Normal service/ingress traffic never presents a loopback peer, so no separate listener or auth are needed.
  • Profile sampling rate is set to 512 KiB mean interval which has negligible steady-state overhead without the feature being active.
  • By default, sampling never runs unless explicitly enabled via the endpoint.

@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 56.73077% with 45 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.20%. Comparing base (3a7b4eb) to head (ef5475c).

Files with missing lines Patch % Lines
objectstore-server/src/endpoints/profiling.rs 55.00% 45 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #522      +/-   ##
==========================================
- Coverage   87.44%   87.20%   -0.24%     
==========================================
  Files          86       87       +1     
  Lines       13892    13993     +101     
==========================================
+ Hits        12148    12203      +55     
- Misses       1744     1790      +46     
Components Coverage Δ
Rust Backend 91.97% <56.73%> (-0.35%) ⬇️
Rust Client 80.07% <ø> (ø)
Python Client 88.51% <ø> (ø)

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jan-auer jan-auer marked this pull request as ready for review June 25, 2026 14:01
@jan-auer jan-auer requested a review from a team as a code owner June 25, 2026 14:01
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