2.5.0 • Published 6 months ago

satisfactory-savegame-prometheus-exporter v2.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

satisfactory-savegame-prometheus-exporter

A Prometheus Exporter that generates metrics from local or remote Satisfactory save game files.

npm version Docker Image Version Issues

Sample Grafana dashboard using the metrics recorded by satisfactory-savegame-prometheus-exporter

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 <savegamelocation> or npm exec express <savegamelocation>, the recommended approach is to use Docker as shown below.

docker run \
  --rm \
  -p 9772:9772 \
  -e SAVEGAME_LOCATION=https://example.com/satisfactory-savegame.sav \
  sleavely/satisfactory-savegame-prometheus-exporter:latest

With Docker Compose:

  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:

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:

  - 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 to skip the build step. Simply call npm run dev with your savegame location as an argument:

npm run dev /mnt/c/Users/potato/AppData/Local/FactoryGame/Saved/SaveGames/

Grafana Dashboard

grafana.json contains a dashboard configuration for metrics using this exporter in tandem with Shinigami92/satisfactory-server-prometheus-exporter

Related

2.3.0

7 months ago

2.5.0

6 months ago

2.4.1

6 months ago

2.3.2

7 months ago

2.2.3

7 months ago

2.4.0

6 months ago

2.3.1

7 months ago

2.2.2

8 months ago

2.2.1

9 months ago

2.2.0

9 months ago

2.1.1

9 months ago

2.1.0

9 months ago

2.0.0

9 months ago

1.0.0

9 months ago