cashapp / cashapp/misk

Client exceptions not recorded in metrics

Open
#1,982 0 comments 0 reactions 0 assignees View on GitHub
monitoring
Dominant language
Kotlin
Stars
472
Forks
242
Avg merge
1d 1h
Merged PRs (30d)
18

Description

Metrics [are recorded by the ClientMetricInterceptor](https://github.com/cashapp/misk/blob/master/misk/src/main/kotlin/misk/client/ClientMetricsInterceptor.kt#L26-L35). The ClientMetricInterceptor records the duration of actions. It annotates them with an action name and the result.

Recently, I had an experience where I was looking to understand the impact of a downstream service's outage. I looked at the metrics. There was no record of the outage in the gRPC client metrics. After some further investigation, I found logs that showed the gRPC client was throwing exceptions. The reason these exceptions weren't recorded was because the only exception that misk makes available as a metric is an `SocketTimeoutException`.

Why not record metrics for any exceptional circumstance? Given that there are already some kinds of errors, it feels like common sense to include these ones too. It would improve visibility and help us understand our systems.

Contributor guide

Open the contributing guide

Research direction

Start with misk/src/main/kotlin/misk/client/ClientMetricsInterceptor.kt, especially the referenced lines, and trace how client action duration, action name, result, and SocketTimeoutException are handled. Confirm the current behavior for other exceptional circumstances and identify the relevant metric expectations. Done means exceptional client failures are represented in the gRPC client metrics so downstream outages are visible.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
observability
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.