semantic-release-bot 8ab72fcdeb chore(release): 1.0.0 [skip ci]
# 1.0.0 (2025-09-19)

### Bug Fixes

* **prometheus-exporter:** fix metric naming to be consistent with prometheus reqs ([431b73e](431b73ee2d))

### Features

* expose production/consumption metrics as metrics.prom ([8a91112](8a911129f6))
* **prometheus-exporter:** add metrics-pole for power metrics ([25026b2](25026b2e73))
2025-09-19 21:12:45 +00:00
2025-09-19 23:11:46 +02:00
2025-09-19 21:12:45 +00:00
2025-09-19 23:11:46 +02:00
2025-09-19 15:27:53 +02:00
2025-09-19 15:26:14 +02:00

Prometheus Exporter

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 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:

• docker volume create factorio_grafana
• docker volume create factorio_prometheus
• docker compose up

Grafana will be served on 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.


The primary repository for this source code is on my private Git platform. Since I don't feel like processing your personal data, you cannot make an account there. In due time this repository will be mirrored to GitHub for issue management. In the meantime, feel free to contact me through e-mail.

This source code is provided under GNU GPLv3. Read more. Please contact me if you wish to inquire about using this source code for purposes forbidden by this license.

Description
No description provided
Readme 415 KiB
v0.0.2 Latest
2025-10-07 19:31:01 +02:00
Languages
Lua 100%