refactor: move away from monorepo setup
This commit is contained in:
38
README.md
38
README.md
@@ -1,9 +1,39 @@
|
||||

|
||||

|
||||
|
||||
This repo houses the Factorio mods that I have made or will make. See each respective mod directory for more details, or see below for a short description of each mod.
|
||||
The prometheus-exporter mod exports metrics from your Factorio game into a Prometheus format. This can then be read by Prometheus and visualized using Grafana (or other platforms that support Prometheus or its metrics format).
|
||||
|
||||
prometheus-exporter
|
||||
: The prometheus-exporter writes several metrics about your Factorio game to a metrics file in Prometheus format. This is then ready to be imported by Prometheus and visualized by Grafana.
|
||||
## Available metrics
|
||||
|
||||
Currently, item and fluid production metrics are available:
|
||||
|
||||
`factorio_(production/consumption)_total`
|
||||
: Gives a counter of item and fluid production or consumption, including the *type* (item or fluid), *surface* (a.k.a. planet), *force* (usually player), and the in-game name of the entity.
|
||||
|
||||
`factorio_energy_(production/consumption)_total_joules`
|
||||
: Total of item and fluid production or consumption, including the *network_id*, *surface* and *name* of the entity using or producing power. Note that the player must place a **Metrics Pole** in the electricity network to track its metrics (to avoid tracking very many tiny networks).
|
||||
|
||||
## Usage
|
||||
|
||||
The mod alone cannot do everything in-game, nor do you want it to, for performance reasons. As such, it does the absolute minimum amount of work necessary to get the metrics onto your filesystem. From here, a sidecar exposes it to Prometheus.
|
||||
|
||||
The [support](./support) directory contains a Docker compose file. Run this using Docker to start the sidecar, Grafana and Prometheus. If you run your own instance of Prometheus and Grafana then I assume that you also know how to serve the metrics.prom file to Prometheus.
|
||||
|
||||
The compose file expects your Factorio script-output to live in `~/.factorio/script-output`, but this might not be where your Factorio data lives. Be sure to update this if your Factorio uses a non-standard location.
|
||||
|
||||
Note that this compose expects two volumes named factorio_grafana and factorio_prometheus to exist. The reason for this is that relative folder binds are annoying and volumes work way more reliably across systems.
|
||||
|
||||
In short, to run the provided setup, from the support folder:
|
||||
```bash
|
||||
• docker volume create factorio_grafana
|
||||
• docker volume create factorio_prometheus
|
||||
• docker compose up
|
||||
```
|
||||
|
||||
Grafana will be served on [localhost:3000](http://localhost:3000), with default credentials being admin/admin. I assume you know what to do from here!
|
||||
|
||||
## Why does this mod exist? Hasn't this been done before?
|
||||
|
||||
There have been Factorio -> Prometheus mods before. However, many of these weren't updated to 2.0 or were very hungry for your UPS. I would like to commit to efficiency while making this mod, meaning that it should be suitable for very large saves. Ideally, the size of the save shouldn't even matter that much. I *will* prefer runtime efficiency over adding new features if a choice has to be made.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||

|
||||
|
||||
The prometheus-exporter mod exports metrics from your Factorio game into a Prometheus format. This can then be read by Prometheus and visualized using Grafana (or other platforms that support Prometheus or its metrics format).
|
||||
|
||||
## Available metrics
|
||||
|
||||
Currently, item and fluid production metrics are available:
|
||||
|
||||
`factorio_(production/consumption)_total`
|
||||
: Gives a counter of item and fluid production or consumption, including the *type* (item or fluid), *surface* (a.k.a. planet), *force* (usually player), and the in-game name of the entity.
|
||||
|
||||
`factorio_energy_(production/consumption)_total_joules`
|
||||
: Total of item and fluid production or consumption, including the *network_id*, *surface* and *name* of the entity using or producing power. Note that the player must place a **Metrics Pole** in the electricity network to track its metrics (to avoid tracking very many tiny networks).
|
||||
|
||||
## Usage
|
||||
|
||||
The mod alone cannot do everything in-game, nor do you want it to, for performance reasons. As such, it does the absolute minimum amount of work necessary to get the metrics onto your filesystem. From here, a sidecar exposes it to Prometheus.
|
||||
|
||||
The [support](./support) directory contains a Docker compose file. Run this using Docker to start the sidecar, Grafana and Prometheus. If you run your own instance of Prometheus and Grafana then I assume that you also know how to serve the metrics.prom file to Prometheus.
|
||||
|
||||
The compose file expects your Factorio script-output to live in `~/.factorio/script-output`, but this might not be where your Factorio data lives. Be sure to update this if your Factorio uses a non-standard location.
|
||||
|
||||
Note that this compose expects two volumes named factorio_grafana and factorio_prometheus to exist. The reason for this is that relative folder binds are annoying and volumes work way more reliably across systems.
|
||||
|
||||
In short, to run the provided setup, from the support folder:
|
||||
```bash
|
||||
• docker volume create factorio_grafana
|
||||
• docker volume create factorio_prometheus
|
||||
• docker compose up
|
||||
```
|
||||
|
||||
Grafana will be served on [localhost:3000](http://localhost:3000), with default credentials being admin/admin. I assume you know what to do from here!
|
||||
|
||||
## Why does this mod exist? Hasn't this been done before?
|
||||
|
||||
There have been Factorio -> Prometheus mods before. However, many of these weren't updated to 2.0 or were very hungry for your UPS. I would like to commit to efficiency while making this mod, meaning that it should be suitable for very large saves. Ideally, the size of the save shouldn't even matter that much. I *will* prefer runtime efficiency over adding new features if a choice has to be made.
|
||||
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 122 KiB |
Reference in New Issue
Block a user