Skip to content
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

Memory profiler #1312

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

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
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