From 310071df1ba3771f624969b55701b884f8c26045 Mon Sep 17 00:00:00 2001 From: bbassie <17990055+bbassie@users.noreply.github.com> Date: Sat, 12 Sep 2026 22:27:24 +0000 Subject: [PATCH] Use a service account name for the metrics scraper Any valid Factorio player name can be claimed by a player joining the cluster, so the docs now create the scraper user as #prometheus. Co-Authored-By: Claude Fable 5.1 --- docs/managing-a-cluster.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/managing-a-cluster.md b/docs/managing-a-cluster.md index a5f08e8a..54dc1ce8 100644 --- a/docs/managing-a-cluster.md +++ b/docs/managing-a-cluster.md @@ -282,12 +282,13 @@ The controller exports metrics for the whole cluster on the `/metrics` endpoint. Fetching it requires a token for a user with the `core.controller.metrics` permission, sent either as an `Authorization: Bearer ` header or as an `X-Access-Token` header. Requests without a valid token get a 401 response and requests for users lacking the permission get a 403 response. -Create a role with just this permission, a user to hold it, and generate a token for that user: +Create a role with just this permission, a user to hold it, and generate a token for that user. +Give the user a name that is not a valid Factorio player name, such as one starting with `#`, so a player joining the cluster can never claim the account and its token: ctl> role create Prometheus --permissions core.controller.metrics - ctl> user create prometheus - ctl> user set-roles prometheus Prometheus - $ npx clusteriocontroller bootstrap generate-user-token prometheus + ctl> user create #prometheus + ctl> user set-roles #prometheus Prometheus + $ npx clusteriocontroller bootstrap generate-user-token '#prometheus' Then pass the token in the scrape job for the controller in `prometheus.yml`: