Export critical performance metrics with ease in pure Lua!
This was written in preparation of FiveM commits #3221 and #3162.
Caution
This project is still a work in progress and not recommended for production use just yet.
Great question! There are a few key reasons behind my decision to implement the Prometheus types in pure Lua:
- Recently, an artifact build caused scripts using
Node.jsto crash the FX server upon restart, leading to my concerns about the current stability ofNode.jsin this environment. Node.jshas slower execution times when interacting with FiveM natives, which could impact performance.- Since the codebase is relatively small, maintaining manual type safety wasn't a significant concern.
While this project is still a work in progress and not recommended for production use just yet, if you're feeling adventurous and want to try it out, here's how to get started.
- Download or clone the repository into your FiveM resources folder.
- Place the
prometheus.cfgfile in your FiveM server's root directory and reference it in yourserver.cfgby addingexec prometheus.cfg. - Configure any authentication settings in the
prometheus.cfgfile as needed. - Add a new Prometheus scrape job using the endpoint
<server_ip>:30120/fx_prometheus.
The data is now ready to be visualised via Grafana.
Attribution-NonCommercial-ShareAlike 4.0 International
