Skip to content

Conversation

@jsdt
Copy link
Contributor

@jsdt jsdt commented Apr 7, 2025

Description of Changes

This adds some gauges related to subscriptions, and adds the reporting to the periodic metric task (instead of updating them each time a subscriber is added or removed). Previously, we just had the number of unique queries. This adds:

  • spacetime_subscription_connections: The number of connections that are subscribed to something.
  • spacetime_subscription_sets: The number of active subscription sets (since clients subscribe to a set at a time)
  • spacetime_query_subscriptions: The sum of the number of subscribers for each query. For example, if 10 clients each subscribed to the same 5 queries, this would be 50.
  • spacetime_legacy_subscriptions: The number of subscriptions that exist with the old API. We should just check that this is 0 at some point.

spacetime_query_subscriptions is probably the most important one to add, since it gives a better sense of how much fanout is possible.

We recompute/update these periodically in the metrics_task for the Host. I added a todo to unregister these when the host is shut down, because the lifecycle is a little messy right now.

API and ABI breaking changes

Expected complexity level and risk

  1. Not very complicated, and the only risk is incorrect metrics, which aren't used for anything critical right now.

Testing

I did a little manual testing locally.

@jsdt jsdt requested a review from joshua-spacetime April 7, 2025 16:17
@bfops bfops added the release-any To be landed in any release window label Apr 7, 2025
@jsdt jsdt enabled auto-merge April 7, 2025 22:06
@jsdt jsdt added this pull request to the merge queue Apr 7, 2025
Merged via the queue into master with commit 6eda3f4 Apr 7, 2025
14 checks passed
@jsdt jsdt deleted the jsdt/subscription-gauges branch April 7, 2025 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-any To be landed in any release window

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants