Skip to content

feat(velocity): add network, session and backend metrics - #11

Merged
TheMeinerLP merged 5 commits into
mainfrom
feat/velocity-network-metrics
Oct 30, 2026
Merged

TheMeinerLP merged 5 commits into
mainfrom
feat/velocity-network-metrics

Conversation

@TheMeinerLP

Copy link
Copy Markdown
Owner

Description

Operators could see how many players were online on each proxy, but not why players failed to connect, which backend was at fault, or which client versions were in use. A backend outage only showed up as unable to connect to server lines in the proxy log.

This change makes the proxy report these facts as metrics:

  • Logins, counted as allowed or denied after all other plugins decided, so a ban shows up as a denied login.
  • Disconnects by reason, and how long each session lasted.
  • Connects to each backend, including the ones a backend refused while the player was still connecting. Kicks from a backend the player was already on are counted separately.
  • Server list pings.
  • Players per client version, and the latency of each online player.
  • Whether each registered backend answers a status ping, and how long the answer takes.

No metric carries a player name, UUID or IP address.

Backend health sends one status ping per backend from each proxy every 30 seconds by default. The pings show up in the backend logs. The interval can be set between 5 and 300 seconds, and the probe can be turned off with otel.enable.backendHealth=false. The other sampled series have their own switches. Existing velocity.properties files keep working through defaults.

Metric names and settings are documented in docs/admin/metrics.md and docs/admin/configuration.md. A new Grafana dashboard, dashboards/grafana/proxy.json, shows the proxy metrics per job.

Change Type

  • Bugfix
  • Feature
  • Refactor
  • Docs
  • Other

Tests

  • Not tested
  • Tested locally (details below)

Details:

  • Unit tests cover the connection listener, client version and latency sampling, the backend probe (reachable, unreachable, removed backend, overlapping rounds, timeout), config defaults and clamping, and service listener registration and probe scheduling.
  • ./gradlew test passes: 38 tests, 0 failures. ./gradlew build passes, and the shaded jar contains no Mockito or JUnit classes.
  • Not tested on a live proxy. The dashboard JSON is validated as JSON but has not been loaded into Grafana yet.

Checklist

  • I ran existing tests or explained why not.
  • I updated relevant documentation.

@TheMeinerLP
TheMeinerLP merged commit 283d947 into main Oct 30, 2026
1 check passed
@TheMeinerLP
TheMeinerLP deleted the feat/velocity-network-metrics branch October 30, 2026 22:12
github-actions Bot pushed a commit that referenced this pull request Oct 30, 2026
## 1.7.0 (2026-10-30)

* feat(velocity): add network, session and backend metrics (#11) ([283d947](283d947)), closes [#11](#11)
* fix(velocity): report the plugin version (#10) ([90b136d](90b136d)), closes [#10](#10)
* build(deps): update release tooling dependencies (#9) ([42b709e](42b709e)), closes [#9](#9)
* docs(openspec): propose velocity metrics and version fix (#8) ([a4f7069](a4f7069)), closes [#8](#8)
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.

1 participant