richat: expose active subscriber count at /subscribers endpoint#206
Open
mindrunner wants to merge 1 commit into
Open
richat: expose active subscriber count at /subscribers endpoint#206mindrunner wants to merge 1 commit into
mindrunner wants to merge 1 commit into
Conversation
Add a new HTTP endpoint on the metrics server that returns the current count of active gRPC subscribers as a plain decimal string. Intended for an external load-balancer weighting loop that polls richat nodes and updates Cloudflare pool origin_weights via API, since CF DNS-only LB steering modes don't read health-check bodies to compute weights. - metrics/src/server.rs: add `/subscribers` route + `get_subscribers` callback parameter. - richat/src/metrics.rs: add `GRPC_SUBSCRIBE_COUNT` shared AtomicUsize and wire it into `spawn_server`. - richat/src/grpc/server.rs: increment/decrement alongside the existing `grpc_subscribe_total` gauge in `SubscribeClientState::new()`/`Drop`. - plugin-agave/src/metrics.rs: pass `|| 0` stub (not applicable).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a new HTTP endpoint on the metrics server that returns the current count of active gRPC subscribers as a plain decimal string. Intended for an external load-balancer weighting loop that polls richat nodes and updates Cloudflare pool origin_weights via API, since CF DNS-only LB steering modes don't read health-check bodies to compute weights.
/subscribersroute +get_subscriberscallback parameter.GRPC_SUBSCRIBE_COUNTshared AtomicUsize and wire it intospawn_server.grpc_subscribe_totalgauge inSubscribeClientState::new()/Drop.|| 0stub (not applicable).