{"id":42223642,"url":"https://github.com/remijouannet/graftorio2","last_synced_at":"2026-01-27T02:17:03.771Z","repository":{"id":37494605,"uuid":"305165274","full_name":"remijouannet/graftorio2","owner":"remijouannet","description":"(fork of graftorio) factorio mod for creating grafana dashboard ","archived":false,"fork":false,"pushed_at":"2024-08-05T13:17:04.000Z","size":252,"stargazers_count":73,"open_issues_count":7,"forks_count":21,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-06T00:23:29.936Z","etag":null,"topics":["factorio","factorio-mod","grafana","prometheus"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remijouannet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-18T18:06:24.000Z","updated_at":"2024-08-05T21:10:10.000Z","dependencies_parsed_at":"2024-08-05T00:07:16.023Z","dependency_job_id":null,"html_url":"https://github.com/remijouannet/graftorio2","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/remijouannet/graftorio2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remijouannet%2Fgraftorio2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remijouannet%2Fgraftorio2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remijouannet%2Fgraftorio2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remijouannet%2Fgraftorio2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remijouannet","download_url":"https://codeload.github.com/remijouannet/graftorio2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remijouannet%2Fgraftorio2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28796965,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T01:07:07.743Z","status":"online","status_checked_at":"2026-01-27T02:00:07.755Z","response_time":168,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["factorio","factorio-mod","grafana","prometheus"],"created_at":"2026-01-27T02:17:03.687Z","updated_at":"2026-01-27T02:17:03.753Z","avatar_url":"https://github.com/remijouannet.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n![](https://mods-data.factorio.com/assets/ad36f974db944b1540ce50a0aea46221f26f7c36.thumb.png)\n[![Github All Releases](https://img.shields.io/github/downloads/remijouannet/graftorio2/total.svg)]()\n\n# [graftorio2](https://mods.factorio.com/mod/graftorio2)\n\n**Fork of [graftorio](https://github.com/afex/graftorio)**\n\n[中文文档](./README_cn.md)\n\nvisualize metrics from your Factorio game in Grafana\n\n![](https://mods-data.factorio.com/assets/89653f5de75cdb227b5140805d632faf41459eee.png)\n\n## What is this?\n\n[Grafana](https://grafana.com/) is an open-source project for rendering time-series metrics.  \nby using [graftorio2](https://mods.factorio.com/mod/graftorio2), you can create a dashboard with various charts monitoring aspects of your Factorio factory.  \nthis dashboard is viewed using a web browser outside of the game client. (works great in a 2nd monitor!)  \n\nin order to use graftorio2, you need to run the Grafana software and a database called [Prometheus](https://prometheus.io/) locally.  \ngraftorio2 automates this process using docker, or you can set these up by hand.\n\n## Installation\n\n1. download the latest [release](https://github.com/remijouannet/graftorio2/releases), and extract it into the location you want to host the local database\n2. [install docker](https://docs.docker.com/install/)\n   - if using windows, you will need to be running Windows 10 Pro\n3. if using macOS or Linux, open the extracted `docker-compose.yml` in a text editor and uncomment the correct path to your Factorio install\n   - for Linux update the permissions in the data dir (since the containers need those rights):\n   - `chown -R 472 config/grafana`\n   - `chown -R 65534 config/prometheus`\n   - `chown -R 472 data/grafana`\n   - `chown -R 65534 data/prometheus`\n4. using a terminal, run `docker-compose up` inside the extracted directory\n5. load `localhost:3000` in a browser, **you should login once and set a secure password!**\n   - there is no need to configure anything:\n   - Prometheus is already configured as default datasource\n6. launch factorio\n7. install the \"graftorio2\" mod via the mods menu\n8. load up your game, and see your statistics in the Grafana dashboards\n\n## Hosting\n\nwhenever you want to publish your dashboard to the public you can do this by placing this upon a server and opening up the ports for your game.  \npreferable all runs on the same server, but separating the game and the Grafana dahsboard is possible.  \nin the following example we'll explain on how to set it up all on 1 server.  \n\n### Part 1: The Website\n\nwhen ever you are hosting this on a server it's prefered to run this as the docker instance.  \nwe placed an [nginx](https://nginx.org/) as reverse proxy in front of it to forward the http(s) requests to the Grafana server.  \n\n```nginx\nserver {\n\tlisten 80;\n\tlisten [::]:80;\n\tserver_name domain.name;\n\treturn 301 https://domain.name$request_uri;\n}\n\nserver {\n\tlocation / {\n\t\tproxy_pass http://127.0.0.1:3000/;\n\t\tproxy_set_header Host $host;\n\t\tproxy_set_header X-Real-IP $remote_addr;\n\t\tproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n\t}\n\n    ssl on;\n    listen [::]:443 ssl;\n    listen 443 ssl;\n    # Here we used a letsencrypt cert (stripped out the actual files)\n    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot\n    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot\n}\n```\n\n### Part 2: The Grafana settings\n\nchange the `environment:` variable in `docker-compose.yml`.  \nfor example the domain name and the root URL you're going to use for the public.  \nthis way dashboards can be made visible to the public.  \nfor more details consult the [Grafana docker documentation](https://grafana.com/docs/grafana/latest/setup-grafana/configure-docker/).  \n\nfor example:\n```yaml\n    environment:\n      - GF_SERVER_DOMAIN=domain.name\n      - GF_SERVER_ROOT_URL=https://%(domain)s/graftorio\n      - GF_SERVER_SERVE_FROM_SUB_PATH=true # the `/graftorio` part of URL\n      - GF_USERS_ALLOW_SIGN_UP=false\n      - GF_AUTH_BASIC_ENABLED=false\n      - GF_AUTH_ANONYMOUS_ENABLED=true\n      - GF_AUTH_ANONYMOUS_ORG_ROLE=Viewer\n      - GF_AUTH_ANONYMOUS_HIDE_VERSION=true\n```\n\n### Part 3: The Prometheus settings\n\nlike for Grafana you may want to set some custom propperties for your Prometheus backend.\nbut for Prometheus you need to set them as `command:` inside the `docker-compose.yml`.\nfor more details consult the [Prometheus docker documentation](https://prometheus.io/docs/prometheus/latest/configuration/configuration/)\n\nfor example:\n```yaml\n    command:\n      - '--storage.tsdb.retention.time=14d'\n```\n\n### Part 4: The exporter\n\nthe exporter needs to have access to your game.prom file, so change the path in the `docker-compose.yml` to where `script-output/graftorio` is found.  \n\n**Separate servers**\n\nwhenever you want to run the game on a different server you would have to change a few things.\n\n1. the exporter needs to run on the same server/computer as your Factorio server/instance.\n2. the Factorio server/instance doesn't need the Prometheus and Grafana dockers. so remove those 2 entries from the `docker-compose.yml`\n3. the exporter needs to be accesible from the web, so that the Prometheus db can access it to load in the required data. more information for the exporter is found here https://github.com/Prometheus/node_exporter\n4. change over the `config/prometheus/prometheus.yml` to let the targets point to your exporters ip:port\n\nhowever when you want to separate this all, keep in mind that most of the default settings in this readme/repo are not correct.  \nso these have to be changed to your needs.\n\n### Finally\n\nopen your http://domain.name and see the login for Grafana.\nkeep in mind that this short guide doesn't explain on how to properly secure everything. this is up to you to fix yourself.\n\n## Metrics\n\nThe list of currently included metrics can be found in [Metrics.md](Metrics.md).\n\n## Dashboards\n\nthis repository includes a variety of ready to use dashboards.  \nthose dashboards are from [Kariton/graftorio2-dashboards](https://github.com/Kariton/graftorio2-dashboards).  \nthe dashboards will be updated within this repostory if new versions are available.  \n\nall dashboards support a variety of different filters, panel links as well as data links.  \nfor example: `Force`, `TimeScale`, `Network`, `Item / Fluid / Building / etc.`  \n  - Force: default `player` - some mods provide their own identifyer.\n  - TimeScale: default `Minute` - is used to calculate values per `Second / Minute / Hour`.\n  - Network: default `all` - depending on context the available networks like `electricity / logistic`.\n  - Item / Fluid / Building etc.: default `all` -  depending on context the available entities.\n\n\n### `Info` - overall stats\n  - UPS\n  - Game Time (Play Time)\n  - Total Players (unique players)\n  - Current online players\n  - Map Seed\n  - Installed mods\n  - Evolution\n  - Evolution Composition\n  - Current research progress\n  - research queue\n  - total rockets launched\n  - rockets per `TimeScale` based on last hour\n\n### `Items` - important items - delta production / consumption\n  - Science delta\n  - Circuits delta\n  - Materials delte (Iron, Copper, Plastic, Steel)\n  - Components delte (Battery, FRF, LDS, RCU, Rocket Fuel)\n\n### `Default` - rebuild of ingame graphs (as close as possible)\n  - 1.1 - Default: Electricity.json\n  - 1.2 - Default: Items.json\n  - 1.3 - Default: Fluids.json\n  - 1.4 - Default: Buildings.json\n  - 1.5 - Default: Pollution.json\n  - 1.6 - Default: Kills.json\n  - 1.7 - Default: Logistics.json\n\n### `Rate` - Various interpretation of \"rate\"\n  - 2.0.1 - Rate: Electricity.json\n  - 2.0.2 - Rate: Items.json\n  - 2.0.2.1 - Rate: Storage.json\n  - 2.0.2.2 - Rate: Science Packs.json\n  - 2.0.3 - Rate: Fluids.json\n  - 2.0.4 - Rate: Buildings.json\n  - 2.0.5 - Rate: Pollution.json\n  - 2.0.6 - Rate: Kills.json\n  - 2.0.7 - Rate: Evolution.json\n  - 2.0.8 - Rate: Research.json\n  - 2.0.9 - Rate: Rockets.json\n  - 2.1.0 - Rate: Players.json\n\n### `Misc` - detailed presentation in various forms\n  - 3.0.1 - Misc: Items.json\n  - 3.0.2 - Misc: Buildings.json\n  - 3.0.4 - Misc: Logistic Networks.json\n  - 3.0.4.1 - Misc: Logistic Items.json\n  - 3.0.4.2 - Misc: Robots.json\n  - 3.0.5 - Misc: Trains.json\n\n### `Mod` - dashboards dedicated to display mod related information\n  - 4.0.1 - Mod: YARM.json\n\n## Debugging\n\n### mod\n\nto see if Factorio is generating stats, confirm a `game.prom` file exists at the configured exporter volume directory.  when opened, it should look something like this:\n\n```\n# HELP factorio_item_production_input items produced\n# TYPE factorio_item_production_input gauge\nfactorio_item_production_input{force=\"player\",name=\"burner-mining-drill\"} 3\nfactorio_item_production_input{force=\"player\",name=\"iron-chest\"} 1\n```\n\n### Prometheus\n\nto see if Prometheus is scraping the data, load `localhost:9090/targets` in a browser and confirm that the status is \"UP\".  \nyou should see the target from `config/Prometheus/Prometheus.yml`.  \n\n### Grafana\n\nto see if the Grafana data source can read correctly, there is already a included `graftorio2` dashboard.  \nthis should show a linear growing `Factorio Tick` panel.  \nalternatively start a new dashboard and add a graph with the query `factorio_item_production_input`.  \nthe graph should render the total of every item produced in your game.  \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremijouannet%2Fgraftorio2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremijouannet%2Fgraftorio2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremijouannet%2Fgraftorio2/lists"}