feat: add periodic WARNING metrics to assist in debugging#12976
feat: add periodic WARNING metrics to assist in debugging#12976agrawal-siddharth wants to merge 1 commit intogoogleapis:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a HealthCheckMetrics system within ConnectionWorker to monitor and log stream health, including latency, retry counts, and error responses. It also adds corresponding unit tests to verify metric gathering and threshold logic. The review feedback highlights several critical thread-safety concerns, recommending synchronization for metric updates and ensuring that shared state, such as the retry count and request queues, is accessed within existing locks to prevent race conditions. Additionally, there are suggestions to improve resource efficiency by caching the Gson instance and declaring constants as static final.
f2bf77d to
4b9d050
Compare
| @@ -249,6 +257,7 @@ class ConnectionWorker implements AutoCloseable { | |||
|
|
|||
| private final RequestProfiler.RequestProfilerHook requestProfilerHook; | |||
| private final TelemetryMetrics telemetryMetrics; | |||
| private final HealthCheckMetrics healthCheckMetrics; | |||
There was a problem hiding this comment.
can we mark the whole healthCheckMetrics guarded by lock ?
There was a problem hiding this comment.
Added the GuardedBy annotation.
However, at present this does not seem to be enforced on this project.
4b9d050 to
ac34cb6
Compare
6a18928 to
865d277
Compare
865d277 to
d7645b8
Compare
No description provided.