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

Add wall clock gauge to proxy metrics #3176

Merged
merged 3 commits into from
Sep 5, 2024
Merged

Add wall clock gauge to proxy metrics #3176

merged 3 commits into from
Sep 5, 2024

Conversation

sfleen
Copy link
Collaborator

@sfleen sfleen commented Sep 5, 2024

Currently, it's not possible to accurately calculate the time remaining before the proxy certificate expires, since the proxy didn't expose its view of what the time is. This exposes the wall clock time (rounded to the nearest second) as a gauge so downstream consumers can calculate the offsets for cert expiry, as well as any other offsets for timestamps we provide.

Example metrics output:

$ curl http://whoami.default:4191/metrics | grep process_clock_time
...
# HELP process_clock_time_seconds Current system time for this proxy.
# TYPE process_clock_time_seconds gauge
# UNIT process_clock_time_seconds seconds
process_clock_time_seconds 1725565062.0

Fixes #12413

@sfleen sfleen requested a review from a team as a code owner September 5, 2024 16:03
Signed-off-by: Scott Fleener <scott@buoyant.io>
Copy link

codecov bot commented Sep 5, 2024

Codecov Report

Attention: Patch coverage is 31.57895% with 13 lines in your changes missing coverage. Please review.

Project coverage is 68.22%. Comparing base (96124bc) to head (bb617f1).
Report is 421 commits behind head on main.

Files with missing lines Patch % Lines
linkerd/metrics/src/process.rs 31.57% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3176      +/-   ##
==========================================
+ Coverage   67.68%   68.22%   +0.54%     
==========================================
  Files         332      353      +21     
  Lines       15158    16551    +1393     
==========================================
+ Hits        10259    11292    +1033     
- Misses       4899     5259     +360     
Files with missing lines Coverage Δ
linkerd/metrics/src/lib.rs 100.00% <ø> (ø)
linkerd/metrics/src/process.rs 71.42% <31.57%> (-9.59%) ⬇️

... and 37 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 80f1c2f...bb617f1. Read the comment docs.

Signed-off-by: Scott Fleener <scott@buoyant.io>
Copy link
Member

@olix0r olix0r left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

Copy link
Collaborator

@cratelyn cratelyn left a comment

Choose a reason for hiding this comment

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

🌮 🌮 🌮

@sfleen sfleen merged commit 8382b72 into linkerd:main Sep 5, 2024
15 checks passed
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.

proxy: expose clock_time_seconds metric
3 participants