Skip to content

Add websocket idle timeout metric#5358

Merged
cloutiertyler merged 3 commits into
masterfrom
bot/ws-nonresponsive-client-metric
Jun 27, 2026
Merged

Add websocket idle timeout metric#5358
cloutiertyler merged 3 commits into
masterfrom
bot/ws-nonresponsive-client-metric

Conversation

@clockwork-labs-bot

Copy link
Copy Markdown
Contributor

Description of Changes

Adds a Prometheus counter for websocket clients that are disconnected after the server considers them idle:

  • spacetime_worker_ws_clients_idle_timed_out_total{database_identity=...}

The counter is incremented at the existing websocket idle-timeout disconnect path, next to the Client ... timed out log.

API and ABI breaking changes

None.

Expected complexity level and risk

  1. This is instrumentation-only and does not change websocket behavior.

Testing

  • rustup run 1.93.0 rustfmt crates/client-api/src/routes/subscribe.rs crates/core/src/worker_metrics/mod.rs
  • git diff --check
  • LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 LANG=en_US.UTF-8 RUSTC=/Users/clockworklabs/.rustup/toolchains/1.93.0-aarch64-apple-darwin/bin/rustc rustup run 1.93.0 cargo check -p spacetimedb-client-api -p spacetimedb-core

@cloutiertyler cloutiertyler enabled auto-merge June 16, 2026 22:29
@cloutiertyler cloutiertyler added this pull request to the merge queue Jun 27, 2026
Merged via the queue into master with commit 8f42f83 Jun 27, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants