Skip to content

feat: memory profiler #1312

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

alv-around
Copy link
Contributor

Hi,

Here is the PR for #1029 which implements metrics recorder for Prometheus. Previous discussion can be found in #1201.

The PR implements a recoder that:

  1. Ttarts a thread which collects process-metrics for a given Duration. It is important that the process metrics (memory/cpu usage.. etc) in it's own separate thread spawned is, otherwise, in an async task will be block anytime the VM performs any of it's cpu-intesive computations.
  2. [metrics_context_tracing](https://docs.rs/metrics-tracing-context/latest/metrics_tracing_context/) enabled( as stated in the docs). so any metric recorded within a span, the span is automatically added as a metric label. However, this does not apply to the process metrics metrics regularly collected in the previous point, because they run in a separate thread.

Usage: In this repo, I made two examples how the memory profiler could work with both (pull/push) prometheus exporters.

@alv-around alv-around marked this pull request as ready for review January 27, 2025 10:54
@jonathanpwang
Copy link
Contributor

Sorry for delay, I'll try to get to this soon.

@alv-around alv-around changed the base branch from main to develop February 26, 2025 09:55
@alv-around alv-around changed the base branch from develop to main February 26, 2025 09:56
@alv-around
Copy link
Contributor Author

alv-around commented Feb 26, 2025

Sorry for delay, I'll try to get to this soon.

Sure no problem, I rebased the branched to latest main.

EDIT:
Nevermind about the rebase. That totally went the wrong way. Looking forward for your feedback.

@jonathanpwang jonathanpwang changed the title Memory profiler feat: memory profiler Apr 1, 2025
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