feat(grounds-velocity): opt-in Prometheus metrics on the proxy pods - #149
Merged
Conversation
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.
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.
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) ongrounds-velocity. Three things, all required before a single series arrives:prometheus.io/{scrape,port,path}on the podmetrics.portas a declared containerPortkeepequalrule keeps only the target whose declared port equals the annotationGROUNDS_METRICS_*envSame 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.minecraftfails 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:metricsport, noGROUNDS_METRICS_ENABLEDprometheus.io/port, env agreeing with both, and the Minecraft port still intact — this is the proxy's whole jobmetrics.port=25565fails to renderBoth 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.