Skip to content

Development

Pavel Erokhin edited this page Nov 9, 2026 · 2 revisions

Stack

  • Go 1.27, with prometheus/client_golang and go.yaml.in/yaml/v3.
  • A distroless image on ghcr.io/mairwunnx/minecraft-exporter, for amd64 and arm64.
  • GitHub Actions: “CI” on every push and pull request, “Release” by hand, “Autopilot” every week.

Check a change

  1. gofmt -l . prints nothing.
  2. go vet ./... and go test -race ./... pass. CI runs the same, then builds the image.
  3. Run the exporter against a real WorldAPI, read-only, and curl /metrics twice, 15 seconds apart. Every group from Metrics shows up, and minecraft_exporter_request_errors_total stays absent.
  4. For a change to what the dashboard shows, build the image locally and look at the dashboard through examples/, as Building from source says.

Adding a metric

  • Count the requests. A new endpoint costs WorldAPI requests on every scrape. Slow data (once a minute or rarer) joins the batched queue in privateItems() instead.
  • Data behind a permission goes through allowed() and done() with the endpoint's name.
  • Change the minecraft-grafana dashboard in the same go when a metric is added, renamed, or changes meaning, and the Metrics page here.
  • Add the change to CHANGELOG.md under the next version.

AI involvement

I write this project together with Claude, Anthropic's AI. CLAUDE.md in the repository (and AGENTS.md, the same file) tells it how the project fits together and what keeps it working.

Every Monday at 03:00 UTC .github/workflows/autopilot.yml runs Claude in GitHub Actions. It updates dependencies with /update-deps, fixes what breaks, pushes to master, and runs the “Release” workflow when the exporter changed. /update-minecraft stops at once here: the exporter follows WorldAPI's endpoints, not the game. Both skills live in .claude/skills/ and match the other projects of the family.

Versions

  • Go: toolchain in go.mod and the golang image in Dockerfile, the same version. The go line stays at the oldest Go the code needs.
  • Images: Dockerfile (golang, gcr.io/distroless/static-debian13:nonroot), and Prometheus and Grafana in examples/compose.yaml.
  • GitHub Actions in .github/workflows/.

Next: Releasing.

Clone this wiki locally