OpenRCT2 Prometheus Exporter
An OpenRCT2 plugin that exports Prometheus metrics for a (limited but growing) set of park metrics.
This plugin requires the OpenRCT2 networking API, available on the OpenRCT2 master branch, in preparation for OpenRCT2 v0.4.0.
The plugin runs in the background, listening for scripts at the address "localhost:9751", which is currently hardcoded into the file, but may be configurable soon.
The following metrics are available. Metric names and labels are subject to change until version 1.0.0.
Yes, these metrics names are bad and don't follow the naming best practices. I consider this to be a bug.
This plugin is maintained in a single file, index.js. While unusal, this allows me to keep the number of dependencies to a minimium and makes it easy for users to install into their copy of OpenRCT2. (This is inspired by the reasoning behind the C single-file libraries list).
This plugin should be written to target EcmaScript 5 only, with no extensions. The plugin environment in OpenRCT2 is not a modern browser nor Node.js installation, and thus only ES5 is reliably available. This policy may change if and when OpenRCT2 upgrades and enables later feature sets of Duktape.
This project uses specific versions and configurations of Prettier and ESLint
using Nix. Once installed, you'll be able to use these versions by running
nix-shell. You can also use a Docker container, similar to the GitHub Actions
You can catch me working on this, or other programming projects, as @consolelog on Twitch. Fill free to come by and ask questions!
If you enjoy using this plugin, I ask that you plant some trees on Ecologi to help offset and reduce our carbon impact.