Skip to content

docs: add debugging guide for game server integration#275

Open
Hauke Löffler (hloeffler) wants to merge 7 commits intomainfrom
docs/debugging-guide
Open

docs: add debugging guide for game server integration#275
Hauke Löffler (hloeffler) wants to merge 7 commits intomainfrom
docs/debugging-guide

Conversation

@hloeffler
Copy link
Copy Markdown
Contributor

Summary

  • Adds a new "Debugging game server integration" page under Monitoring (src/multiplayer-servers/monitoring/debugging.md)
  • Updates the Monitoring sidebar to include the new page

What's in the guide

  • Recommends using Vessels for integration and debugging (single game server, UI restart, logs in UI)
  • How to view container logs: Vessel UI for Vessels, Grafana (Current Gameservers → Gameserver Single Instance dashboard) for Formations/Armadas
  • How to inspect the Agones SDK game server object from within the pod
  • How to check environment variables for common misconfigurations
  • How to build and deploy a lightweight debugger sidecar that prints env vars and polls the game server object every 10 seconds (full Dockerfile and script included)
  • How to debug the allocation flow by setting LOG_LEVEL=debug on the Allocation Sidecar

Copilot AI review requested due to automatic review settings April 20, 2026 15:36
@hloeffler Hauke Löffler (hloeffler) requested a review from a team as a code owner April 20, 2026 15:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/multiplayer-servers/monitoring/debugging.md Outdated
Comment thread src/multiplayer-servers/monitoring/debugging.md Outdated
Comment thread src/multiplayer-servers/monitoring/debugging.md
Comment thread src/multiplayer-servers/monitoring/debugging.md Outdated
Comment thread src/multiplayer-servers/monitoring/debugging.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 20, 2026 15:52
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment thread src/multiplayer-servers/monitoring/debugging.md Outdated
Comment thread src/multiplayer-servers/monitoring/debugging.md
Comment thread src/multiplayer-servers/monitoring/debugging.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 21, 2026 07:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment thread src/multiplayer-servers/monitoring/debugging.md Outdated
Comment on lines +64 to +67
echo "hello from the debugger"
echo
echo "ENV"
env
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread src/multiplayer-servers/monitoring/debugging.md
Comment thread src/multiplayer-servers/monitoring/debugging.md Outdated
Comment thread src/multiplayer-servers/monitoring/debugging.md Outdated
Comment thread src/multiplayer-servers/monitoring/debugging.md Outdated
Comment thread src/multiplayer-servers/monitoring/debugging.md Outdated
Comment thread src/multiplayer-servers/monitoring/debugging.md
Comment thread src/multiplayer-servers/monitoring/debugging.md Outdated
Comment thread src/multiplayer-servers/monitoring/debugging.md Outdated
Comment on lines +84 to +94
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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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...".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/multiplayer-servers/monitoring/debugging.md
Comment thread src/multiplayer-servers/monitoring/debugging.md

## 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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes,
but for allocation, vessel will also work and is way easierer

Comment thread src/multiplayer-servers/monitoring/debugging.md Outdated

## 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:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can users get access to inside of the pod? Is that described somewhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they can't no feature at the moment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I'd say we need to change this phrasing because thats what it implies to me 😄

Comment on lines +51 to +57
## 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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copilot AI review requested due to automatic review settings April 21, 2026 10:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

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`.
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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`.

Copilot uses AI. Check for mistakes.
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.
Comment on lines +64 to +67
echo "hello from the debugger"
echo
echo "ENV"
env
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +84 to +94
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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +130 to +133
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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all the same numbers?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is on purpose, doing this renders the markdown correctly and makes it easier to add/remove/reorder items in the future

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's called lazy numbering

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 😄

Comment thread src/multiplayer-servers/monitoring/debugging.md
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.

5 participants