<#7643 feat: add Prometheus counter for dropped su...
# flyte-github
a
#7643 feat: add Prometheus counter for dropped subscriber updates Pull request opened by falloficaruss Tracking issue Closes #7641 Why are the changes needed? Currently, when a subscriber channel is full, dropped updates are only logged at the
Warnf
level. This makes it difficult to detect chronic subscriber backpressure in production — logs are ephemeral, and there is no metric to alert on. Adding a Prometheus counter allows operators to: 1. Monitor subscriber channel capacity over time via dashboards. 2. Configure alerting (e.g., PagerDuty) when drop rates exceed a threshold. 3. Distinguish between transient drops (acceptable) and sustained backpressure (indicating a subscriber is too slow or the buffer is too small). What changes were proposed in this pull request? This PR adds a
dropped_updates
Prometheus counter to the
ActionsClient
struct in `actions/k8s/client.go`: 1. New field —
droppedUpdates prometheus.Counter
added to the
ActionsClient
struct. 2. Initialization — The counter is created via
scope.MustNewCounter("dropped_updates", ...)
in
NewActionsClient
. 3. Increment on drop —
c.droppedUpdates.Inc()
is called in the
default
branch of the subscriber notification
select
, right before the existing
Warnf
log. No behavioral changes beyond the metric emission. All existing tests continue to pass. How was this patch tested? Existing tests (TestSubscribeIsScopedByRun, TestUnsubscribeScopedByRun) call c.notifySubscribers directly with buffered channels that never fill, so they never hit the default branch and the nil counter is unreachable, they continue to pass. Labels • added Setup process Screenshots Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. Related PRs Stack If you do use
git town
to manage PR Stacks, the stack relevant to this PR will show below. Otherwise, you can ignore this section. Docs link flyteorg/flyte