Documentation
¶
Overview ¶
Command analyticsd is experimental: its command-line interface may change in a minor release; see https://nsgo.games/docs/stability/.
Command analyticsd runs the self-hosted analytics collector as a standalone HTTP server, persisting deduplicated events to daily UTC JSON Lines files (-data) or PostgreSQL (-postgres / ANALYTICS_POSTGRES_DSN).
analyticsd init -config analytics.yaml -catalog catalog.yaml analyticsd serve -config analytics.yaml -catalog catalog.yaml -keyset keys.yaml -data events -addr :8083 ANALYTICS_POSTGRES_DSN=postgres://... analyticsd serve -config analytics.yaml -catalog catalog.yaml -keyset keys.yaml -addr :8083
init writes a starter collector configuration and optional event catalog YAML without overwriting existing files. serve runs until SIGINT or SIGTERM, serving POST /v1/events (gzip or plain JSON Lines, idempotent by install+seq) and POST /v1/properties (authenticated per-account custom scalar properties). When -keyset is provided, Authorization: Bearer account tokens are verified for the configuration's audience ("analytics" by default) and refused when that audience matches the game servers' audience in the key set. With metrics set in the configuration, serve also serves GET /healthz, GET /readyz and GET /metrics on that dedicated address.