-
Notifications
You must be signed in to change notification settings - Fork 270
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
metrics: Use prometheus
for process metrics
#2543
Closed
Closed
Conversation
This file contains 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
We currently have our own implementation of system level metrics. This is unnecessary. The `prometheus` crate provides a _process_ feature that bundles prometheus's default process-level metrics. This adds a `process_threads` metric. This change also updates the static `proxy_build_info` metric to be exported via the default prometheus registry. This allows us to export this metric from the top-level `linkerd2-proxy` crate so that the build metadata is not inferred from the linkerd-app-core crate (fixing an old TODO). --- Before > # HELP process_start_time_seconds Time that the process started (in seconds since the UNIX epoch) > # TYPE process_start_time_seconds gauge > process_start_time_seconds 1701551542 > # HELP process_uptime_seconds_total Total time since the process started (in seconds) > # TYPE process_uptime_seconds_total counter > process_uptime_seconds_total 1782.137 > # HELP process_cpu_seconds_total Total user and system CPU time spent in seconds. > # TYPE process_cpu_seconds_total counter > process_cpu_seconds_total 0.72 > # HELP process_virtual_memory_bytes Virtual memory size in bytes. > # TYPE process_virtual_memory_bytes gauge > process_virtual_memory_bytes 111042560 > # HELP process_resident_memory_bytes Resident memory size in bytes. > # TYPE process_resident_memory_bytes gauge > process_resident_memory_bytes 33910784 > # HELP process_open_fds Number of open file descriptors. > # TYPE process_open_fds gauge > process_open_fds 28 > # HELP process_max_fds Maximum number of open file descriptors. > # TYPE process_max_fds gauge > process_max_fds 1048576 > # HELP proxy_build_info Proxy build info > # TYPE proxy_build_info gauge > proxy_build_info{version="2.213.0",git_sha="9f7e7ac",profile="release",date="2023-11-16T23:24:26Z",vendor="linkerd"} 1 After: > # HELP process_cpu_seconds_total Total user and system CPU time spent in seconds. > # TYPE process_cpu_seconds_total counter > process_cpu_seconds_total 0 > # HELP process_max_fds Maximum number of open file descriptors. > # TYPE process_max_fds gauge > process_max_fds 1048576 > # HELP process_open_fds Number of open file descriptors. > # TYPE process_open_fds gauge > process_open_fds 24 > # HELP process_resident_memory_bytes Resident memory size in bytes. > # TYPE process_resident_memory_bytes gauge > process_resident_memory_bytes 27656192 > # HELP process_start_time_seconds Start time of the process since unix epoch in seconds. > # TYPE process_start_time_seconds gauge > process_start_time_seconds 1701553218 > # HELP process_threads Number of OS threads in the process. > # TYPE process_threads gauge > process_threads 2 > # HELP process_uptime_seconds_total Total time since the process started (in seconds) > # TYPE process_uptime_seconds_total gauge > process_uptime_seconds_total 9.700919434 > # HELP process_virtual_memory_bytes Virtual memory size in bytes. > # TYPE process_virtual_memory_bytes gauge > process_virtual_memory_bytes 109264896 > # HELP proxy_build_info Proxy build info > # TYPE proxy_build_info gauge > proxy_build_info{date="2023-12-02T21:32:40Z",git_sha="9a4d02c6f",profile="release",vendor="code@ver-sea",version="0.0.0-dev.9a4d02c6f"} 1
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2543 +/- ##
==========================================
- Coverage 67.39% 67.31% -0.08%
==========================================
Files 329 327 -2
Lines 14652 14568 -84
==========================================
- Hits 9874 9807 -67
+ Misses 4778 4761 -17
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
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.
We currently have our own implementation of system level metrics. This is unnecessary. The
prometheus
crate provides a process feature that bundles prometheus's default process-level metrics. This adds aprocess_threads
metric.This change also updates the static
proxy_build_info
metric to be exported via the default prometheus registry. This allows us to export this metric from the top-levellinkerd2-proxy
crate so that the build metadata is not inferred from the linkerd-app-core crate (fixing an old TODO).Before
After: