Skip to content

feat(grounds-velocity): opt-in Prometheus metrics on the proxy pods - #149

Merged
hbrombeer merged 1 commit into
mainfrom
feat/velocity-metrics
Aug 3, 2026
Merged

feat(grounds-velocity): opt-in Prometheus metrics on the proxy pods#149
hbrombeer merged 1 commit into
mainfrom
feat/velocity-metrics

Conversation

@hbrombeer

Copy link
Copy Markdown
Member

groundsgg/plugin-proxy#31 gives the proxy a Prometheus endpoint — players on it, backends it has registered, the network count it reports in the server list, plus the JVM. Nothing in a cluster asks it for one.

What

metrics.enabled (default false) on grounds-velocity. Three things, all required before a single series arrives:

Why it alone is not enough
prometheus.io/{scrape,port,path} on the pod how the satellite's Alloy discovers the target
metrics.port as a declared containerPort the agent's keepequal rule keeps only the target whose declared port equals the annotation
GROUNDS_METRICS_* env without it plugin-proxy binds nothing and the scrape is refused

Same contract as grounds-gamemode (#147), and the same silent failure if one is missing — worse here, because a proxy with a broken metrics port carries on serving Minecraft perfectly well, so nothing else looks wrong either.

Guard rail

metrics.port == ports.minecraft fails at template time. Left to the plugin it would be "Address already in use" in a log nobody reads, on a proxy that still works.

Verification

scripts/test-velocity-metrics.sh, wired into CI beside the gamemode one. Renders both ways and asserts:

  • off (the default): no annotation, no metrics port, no GROUNDS_METRICS_ENABLED
  • on: all three annotations, the metrics port declared as a containerPort equal to prometheus.io/port, env agreeing with both, and the Minecraft port still intact — this is the proxy's whole job
  • collision: metrics.port=25565 fails to render

Both contract tests pass locally. Chart version left alone — release-please owns it.

Needs plugin-proxy 1.1.0 or newer in the image, said in values.yaml: on an older one the annotations point at a closed port.

plugin-proxy can now publish players on the proxy, backends it has registered
and the network count it reports in the server list, plus the JVM under them.
Nothing in a cluster asks it to.

`metrics.enabled` (default false) does the three things that all have to agree
before a single series arrives: the prometheus.io annotations the satellite's
metrics agent discovers on, `metrics.port` as a declared containerPort — the
agent keeps only the target whose port equals the annotation — and
GROUNDS_METRICS_* so the plugin binds the endpoint.

Same contract as grounds-gamemode, and the same failure if any one is missing:
a pod that looks instrumented and reports nothing. Worse here, because a proxy
with a broken metrics port carries on serving Minecraft, so nothing else looks
wrong either. scripts/test-velocity-metrics.sh covers all three plus the
Minecraft port surviving beside them.

`metrics.port` equal to `ports.minecraft` fails at template time.
@hbrombeer
hbrombeer merged commit d9d370c into main Aug 3, 2026
4 checks passed
@hbrombeer
hbrombeer deleted the feat/velocity-metrics branch August 3, 2026 09:38
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