remijouannet / graftorio2

(fork of graftorio) factorio mod for creating grafana dashboard
MIT License
77 stars 21 forks source link

train stats aren't working #5

Closed phdoerfler closed 3 years ago

phdoerfler commented 3 years ago

https://github.com/remijouannet/graftorio2/blob/master/control.lua#L31-L41 suggests there are a number of train related metrics, yet I can't find any in prometheus:

image

Mod version is 0.0.13, Factorio is current stable 1.1.30.

remijouannet commented 3 years ago

i'm gonna release a new version soon since someone made a PR, i'm gonna check the train stats

remijouannet commented 3 years ago

i see you have metrics name with typo "coount" "entitybuild", did you edit the mod code ? i did not find any typo in the source

phdoerfler commented 3 years ago

No, we did not alter the mod. It was downloaded through Factorio‘s mod syncing facility.

On 21. Apr 2021, at 13:33, Remi Jouannet @.***> wrote:

 i see you have metrics name with typo "coount" "entitybuild", did you edit the mod code ? i did not find any typo in the source

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

lupo42 commented 3 years ago

Regarding "typos": Those may be the result of a race condition hitting when the mod is writing to the game.prom file at the same time the prometheus node-exporter is reading from it.

Running $ while true; do cat script-output/graftorio2/game.prom | grep -v -e factorio_entity_build_count_ -e factorio_kill_count_ -e factorio_fluid_production_ -e factorio_item_production_ -e factorio_items_launched_ -e '^\s*$' -e '^#' -e factorio_tick ; done for some time yields hits like factoriio_kill_count_input{force="player",name="big-worm-turret"} 5 eventually.

remijouannet commented 3 years ago

the train stats are fix in the 0.0.14 version, regarding the race condition i can't really fix it, factorio doesn't give many api call to manipulate file