docs: add debugging guide for game server integration#275
docs: add debugging guide for game server integration#275Hauke Löffler (hloeffler) wants to merge 7 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new Monitoring documentation page to help users debug game server integrations, and wires it into the Monitoring sidebar so it’s discoverable within the VitePress site structure.
Changes:
- Added a new guide: Debugging game server integration (logs, Agones SDK inspection, env var checks, debugger sidecar, allocation debugging).
- Updated the Monitoring sidebar to include the new Debugging page.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/multiplayer-servers/monitoring/sidebar.json |
Adds a new sidebar entry pointing to the new debugging guide. |
src/multiplayer-servers/monitoring/debugging.md |
Introduces a new end-to-end debugging guide for integration issues, including operational steps and example sidecar tooling. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| echo "hello from the debugger" | ||
| echo | ||
| echo "ENV" | ||
| env |
There was a problem hiding this comment.
The example debugger sidecar script prints the full environment (env), which is very likely to include secrets (for example allocation tokens) and can accidentally leak them into shared/retained logs. Consider changing the example to print only the specific non-secret variables you need for debugging, or demonstrate redaction/masking of known sensitive keys by default so the "safe" path is the one people copy/paste.
There was a problem hiding this comment.
that's a valid point to make, even when trying to debug. Instructing users to do so goes against general security best practices. It also opens up a whole can of worms w.r.t. the blast radius of such a logging behaviour. Instead of "instructing" users to print their ENVs, give them pointers as to what they can do in such scenarios in a textual way: if they want to print their envs, its entirely on them to make that decision
| FROM ubuntu:22.04 | ||
|
|
||
| # 2. Pre-install requirements. | ||
| RUN apt-get update \ | ||
| && apt-get install -y gnupg ca-certificates curl jq \ | ||
| && apt-get clean -y | ||
|
|
||
| # 3. Prepare a working directory and permissions. | ||
| RUN mkdir /app | ||
| RUN useradd -m -u 1000 debugger | ||
| RUN chown debugger:debugger /app |
There was a problem hiding this comment.
Are the permissions required for what your debugger does?
Why ubuntu:22.04. That's like 4 years old, use latest?
I personally would have chosen a more compact image/approach. Like, "you just need bash, here you go with alpine/busybox. You need full-scale development tools, better choose "ubuntu:latest" and install custom packages like this...".
There was a problem hiding this comment.
ubuntu:22.04 is still supported
and switching to 24.04 will break the build
permissions are needed for stuff,
also we have: https://docs.gamefabric.com/multiplayer-servers/getting-started/building-a-container-image#create-a-dockerfile
There was a problem hiding this comment.
Ubuntu 24:04 only breaks the build because the image now includes a default non-root user at UID 1000 by default. You can still use ubuntu 24.04, just don't do useradd -u 1000.
|
|
||
| ## Use Vessels for integration and debugging | ||
|
|
||
| Even if your game ultimately requires [Armadas](/multiplayer-servers/getting-started/glossary#armada), use a [Vessel](/multiplayer-servers/getting-started/glossary#vessel) during integration and debugging. Vessels give you a single game server that you can restart directly from the UI, and container logs are visible in the UI without any additional setup. This makes the feedback loop much faster than working with Armadas. |
There was a problem hiding this comment.
I would say start with a Vessel, but still run tests with Armadas as well before deploying the real stuff since there are some fundamental differences in configuration etc that they'd still likely need to experiment with a bit. WDYT?
There was a problem hiding this comment.
yes,
but for allocation, vessel will also work and is way easierer
|
|
||
| ## Inspecting the game server object | ||
|
|
||
| The Agones SDK exposes a local REST endpoint inside every game server pod. You can query it from within the pod to see the current game server state, addresses, ports, labels, and annotations: |
There was a problem hiding this comment.
How can users get access to inside of the pod? Is that described somewhere?
There was a problem hiding this comment.
they can't no feature at the moment
There was a problem hiding this comment.
Then I'd say we need to change this phrasing because thats what it implies to me 😄
| ## Using a debugger sidecar | ||
|
|
||
| If you cannot easily add diagnostic commands to your game server, you can run a lightweight sidecar container that automatically prints environment variables on start and polls the Agones SDK game server object every 10 seconds. Because this output can include secrets, use it only in non-production environments or redact sensitive values before sending logs to shared systems. | ||
|
|
||
| ### Building the debugger sidecar image | ||
|
|
||
| Create the following two files and build the container image. |
There was a problem hiding this comment.
I would emphasize that this is only an example and that they can write a debugger sidecar however they wish, including safer solutions than this
Co-authored-by: Christian R <antiphp@users.noreply.github.com>
| curl "http://localhost:${AGONES_SDK_HTTP_PORT}/gameserver" | jq '.' | ||
| ``` | ||
|
|
||
| This endpoint is only accessible from within the pod. The `AGONES_SDK_HTTP_PORT` environment variable is always set in every container in the pod and defaults to `9358`. |
There was a problem hiding this comment.
This sentence claims AGONES_SDK_HTTP_PORT is always set in every container in the pod. Elsewhere the docs state it's set in “your container” by Agones, which is less absolute; if sidecars don't reliably get this env var, the current wording is inaccurate. Consider softening the guarantee and/or suggesting a fallback to the default port when the variable isn't present.
| This endpoint is only accessible from within the pod. The `AGONES_SDK_HTTP_PORT` environment variable is always set in every container in the pod and defaults to `9358`. | |
| This endpoint is only accessible from within the pod. Agones sets `AGONES_SDK_HTTP_PORT` for the game server container. If that variable is not present in the container you are using, use the default port `9358`. |
Reword Vessels section to recommend also testing with Armadas before production. Add Vessel UI caveats for log volume and previous container runs. Broaden Grafana log scope beyond Formations/Armadas. Clarify that in-pod commands run from entrypoint scripts or sidecars, not via exec. Show curl without jq as primary example. Replace inline warning with admonition blocks, note env unavailability in distroless images, and remove redundant "pay special attention" line. Rename "debugger sidecar" to "debug sidecar" throughout. Emphasize the sidecar is only an example. Add --platform linux/amd64 to docker build and link to existing Dockerfile guide.
| echo "hello from the debugger" | ||
| echo | ||
| echo "ENV" | ||
| env |
There was a problem hiding this comment.
that's a valid point to make, even when trying to debug. Instructing users to do so goes against general security best practices. It also opens up a whole can of worms w.r.t. the blast radius of such a logging behaviour. Instead of "instructing" users to print their ENVs, give them pointers as to what they can do in such scenarios in a textual way: if they want to print their envs, its entirely on them to make that decision
| FROM ubuntu:22.04 | ||
|
|
||
| # 2. Pre-install requirements. | ||
| RUN apt-get update \ | ||
| && apt-get install -y gnupg ca-certificates curl jq \ | ||
| && apt-get clean -y | ||
|
|
||
| # 3. Prepare a working directory and permissions. | ||
| RUN mkdir /app | ||
| RUN useradd -m -u 1000 debugger | ||
| RUN chown debugger:debugger /app |
There was a problem hiding this comment.
Ubuntu 24:04 only breaks the build because the image now includes a default non-root user at UID 1000 by default. You can still use ubuntu 24.04, just don't do useradd -u 1000.
| 1. Navigate to your [Formation](/multiplayer-servers/getting-started/glossary#formation), [Vessel](/multiplayer-servers/getting-started/glossary#vessel), [ArmadaSet](/multiplayer-servers/getting-started/glossary#armadaset), or [Armada](/multiplayer-servers/getting-started/glossary#armada) configuration. | ||
| 1. In the **Sidecars** section, select **Create from scratch**. | ||
| 1. Set the container image to your debug sidecar image. | ||
| 1. Save your changes. |
There was a problem hiding this comment.
all the same numbers?
There was a problem hiding this comment.
This is on purpose, doing this renders the markdown correctly and makes it easier to add/remove/reorder items in the future
There was a problem hiding this comment.
It's called lazy numbering
There was a problem hiding this comment.
However, if the list is small, and you don’t anticipate changing it, prefer fully numbered lists, because it is nicer to read in source.
I suppose 4 qualifies as "long"?
There was a problem hiding this comment.
Considering how often our docs are shifting in this repo I'd personally recommend always doing lazy numbering here :p Some less volatile docs I'd be fine with regular numbered lists. But this whole place is chaos incarnate 😄
Summary
src/multiplayer-servers/monitoring/debugging.md)What's in the guide