-
Notifications
You must be signed in to change notification settings - Fork 894
chore: add prometheus monitoring of workspace traffic generation #7583
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
Changes from 1 commit
f62cf16
00b9eca
9a9778c
f00b8d7
69bc5ad
57d338d
a1d14df
fb96c4d
59ef445
6734521
4ab2314
d54af33
8c48d2b
cf00b5a
e6917e6
ea71c4f
399e506
ec96a00
a4ecd0c
fe0ecfc
239ba96
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -195,7 +195,7 @@ type countReadWriter struct { | |
func (w *countReadWriter) Read(p []byte) (int, error) { | ||
start := time.Now() | ||
n, err := w.ReadWriter.Read(p) | ||
w.metrics.ReadLatencyMS.WithLabelValues(w.labels...).Observe(time.Since(start).Seconds()) | ||
w.metrics.ReadLatencySeconds.WithLabelValues(w.labels...).Observe(time.Since(start).Seconds()) | ||
if n > 0 { | ||
w.bytesRead.Add(int64(n)) | ||
w.metrics.BytesRead.WithLabelValues(w.labels...).Add(float64(n)) | ||
|
@@ -206,7 +206,7 @@ func (w *countReadWriter) Read(p []byte) (int, error) { | |
func (w *countReadWriter) Write(p []byte) (int, error) { | ||
start := time.Now() | ||
n, err := w.ReadWriter.Write(p) | ||
w.metrics.WriteLatencyMS.WithLabelValues(w.labels...).Observe(time.Since(start).Seconds()) | ||
w.metrics.WriteLatencySeconds.WithLabelValues(w.labels...).Observe(time.Since(start).Seconds()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm curious if we need another metric (bytes?) to calculate the bandwidth. As far as I see, there are only There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given that bytes per tick and ticks per second are inputs to this, I think we should probably be OK. But good food for thought! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You calc throughput by the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch, will address in a follow-up There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prometheus itself will happily compute the time derivative of any metric, so a counter of bytes written is all we need. |
||
if n > 0 { | ||
w.bytesWritten.Add(int64(n)) | ||
w.metrics.BytesWritten.WithLabelValues(w.labels...).Add(float64(n)) | ||
johnstcn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
Uh oh!
There was an error while loading. Please reload this page.