https://github.com/sleavely/satisfactory-savegame-prometheus-exporter
A Prometheus exporter for savegame metrics from Satisfactory
https://github.com/sleavely/satisfactory-savegame-prometheus-exporter
metrics prometheus prometheus-exporter satisfactory
Last synced: about 1 year ago
JSON representation
A Prometheus exporter for savegame metrics from Satisfactory
- Host: GitHub
- URL: https://github.com/sleavely/satisfactory-savegame-prometheus-exporter
- Owner: Sleavely
- License: mit
- Created: 2024-10-21T20:10:17.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-21T09:48:49.000Z (over 1 year ago)
- Last Synced: 2025-04-25T15:00:24.953Z (about 1 year ago)
- Topics: metrics, prometheus, prometheus-exporter, satisfactory
- Language: TypeScript
- Homepage: https://hub.docker.com/r/sleavely/satisfactory-savegame-prometheus-exporter
- Size: 500 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# satisfactory-savegame-prometheus-exporter
A Prometheus Exporter that generates metrics from local or remote Satisfactory save game files.
[  ](https://npmjs.org/package/satisfactory-savegame-prometheus-exporter "View this project on npm") [ 
](https://hub.docker.com/r/sleavely/satisfactory-savegame-prometheus-exporter) [  ](https://github.com/Sleavely/satisfactory-savegame-prometheus-exporter/issues)

## Usage
The `SAVEGAME_LOCATION` environment variable can be a URL or a local path to a file or a folder. If a folder is supplied, it will recursively find the latest file.
While you can run the `bin` scripts with `npm exec cli ` or `npm exec express `, the recommended approach is to use Docker as shown below.
```sh
docker run \
--rm \
-p 9772:9772 \
-e SAVEGAME_LOCATION=https://example.com/satisfactory-savegame.sav \
sleavely/satisfactory-savegame-prometheus-exporter:latest
```
With Docker Compose:
```yaml
savegame_metrics_exporter:
image: sleavely/satisfactory-savegame-prometheus-exporter:latest
restart: unless-stopped
volumes:
- ./config/saved/server:/savegames:ro
environment:
- HOST=0.0.0.0
- PORT=9772
- SAVEGAME_LOCATION=/savegames
networks:
- grafana
hostname: satisfactory-savegame-metrics
```
On Windows you can mount your savegame directory by referring to `%LocalAppData%`, like this:
```sh
docker run \
--rm \
-p 9772:9772 \
-v %LocalAppData%\FactoryGame\Saved\SaveGames\:/savegames:ro \
-e SAVEGAME_LOCATION=/savegames \
sleavely/satisfactory-savegame-prometheus-exporter:latest
```
Then, in your Prometheus configuration `scrape_configs`:
```yaml
- job_name: "satisfactory-savegame-exporter"
# How often metrics will be collected.
# Recommended value is half of your autosave interval.
scrape_interval: 5m
static_configs:
# Only one of these targets is really necessary, but it depends on
# how you've configured networking for the exporter container and Prometheus.
- targets:
- 'localhost:9772'
- 'host.docker.internal:9772'
- 'satisfactory-savegame-metrics:9772'
```
For local development we rely on [`tsx`](https://tsx.is/) to skip the build step. Simply call `npm run dev` with your savegame location as an argument:
```sh
npm run dev /mnt/c/Users/potato/AppData/Local/FactoryGame/Saved/SaveGames/
```
## Grafana Dashboard
[grafana.json](./grafana.json) contains a dashboard configuration for metrics using this exporter in tandem with [`Shinigami92/satisfactory-server-prometheus-exporter`](https://github.com/Shinigami92/satisfactory-server-prometheus-exporter)
## Related
- [wolveix/satisfactory-server](https://github.com/wolveix/satisfactory-server) - A Docker image for running a Satisfactory Dedicated Server.
- [Shinigami92/satisfactory-server-prometheus-exporter](https://github.com/Shinigami92/satisfactory-server-prometheus-exporter) - Prometheus Exporter for the metrics exposed from the Satisfactory Dedicated Server
- [etothepii4/satisfactory-file-parser](https://github.com/etothepii4/satisfactory-file-parser) - TypeScript Module to parse Satisfactory save files
- [greeny/SatisfactoryTools](https://github.com/greeny/SatisfactoryTools) - Satisfactory Tools for planning and building the perfect base.