diff --git a/control.lua b/control.lua index 99f56ff..bf33690 100644 --- a/control.lua +++ b/control.lua @@ -5,8 +5,8 @@ require("research-stats") require("power-stats") require("logistic-network-stats") -tickInterval = tonumber(settings.global["factorio-prometheus-exporter-tick-interval"].value) or 300 -udpAddress = tonumber(settings.startup["factorio-prometheus-exporter-udp-address"].value) or 52555 +tickInterval = tonumber(settings.global["factorio-metrics-exporter-tick-interval"].value) or 300 +udpAddress = tonumber(settings.startup["factorio-metrics-exporter-udp-address"].value) or 52555 isInitialized = false sendIndex = 0 @@ -34,33 +34,33 @@ script.on_init(function () storage.labs = {} sendIndex = 0 - options.enableMod = settings.global["factorio-prometheus-exporter-enable"].value - options.enableProduction = settings.global["factorio-prometheus-exporter-export_production_stats"].value - options.enablePollution = settings.global["factorio-prometheus-exporter-export_pollution_stats"].value - options.enableFluid = settings.global["factorio-prometheus-exporter-export_fluid_stats"].value - options.enablePlayers = settings.global["factorio-prometheus-exporter-export_player_stats"].value - options.enableKills = settings.global["factorio-prometheus-exporter-export_kill_stats"].value - options.enablePower = settings.global["factorio-prometheus-exporter-export_power_stats"].value - options.enableResearch = settings.global["factorio-prometheus-exporter-export_research_stats"].value - options.enableRobots = settings.global["factorio-prometheus-exporter-export_logistic_stats"].value + options.enableMod = settings.global["factorio-metrics-exporter-enable"].value + options.enableProduction = settings.global["factorio-metrics-exporter-export_production_stats"].value + options.enablePollution = settings.global["factorio-metrics-exporter-export_pollution_stats"].value + options.enableFluid = settings.global["factorio-metrics-exporter-export_fluid_stats"].value + options.enablePlayers = settings.global["factorio-metrics-exporter-export_player_stats"].value + options.enableKills = settings.global["factorio-metrics-exporter-export_kill_stats"].value + options.enablePower = settings.global["factorio-metrics-exporter-export_power_stats"].value + options.enableResearch = settings.global["factorio-metrics-exporter-export_research_stats"].value + options.enableRobots = settings.global["factorio-metrics-exporter-export_logistic_stats"].value end) script.on_load(function () - log("factorio-prometheus-exporter: on_load") + log("factorio-metrics-exporter: on_load") log("tickInterval: "..tickInterval) log("udpAddress: "..udpAddress) - options.enableMod = settings.global["factorio-prometheus-exporter-enable"].value - options.enableProduction = settings.global["factorio-prometheus-exporter-export_production_stats"].value - options.enablePollution = settings.global["factorio-prometheus-exporter-export_pollution_stats"].value - options.enableFluid = settings.global["factorio-prometheus-exporter-export_fluid_stats"].value - options.enablePlayers = settings.global["factorio-prometheus-exporter-export_player_stats"].value - options.enableKills = settings.global["factorio-prometheus-exporter-export_kill_stats"].value - options.enablePower = settings.global["factorio-prometheus-exporter-export_power_stats"].value - options.enableResearch = settings.global["factorio-prometheus-exporter-export_research_stats"].value - options.enableRobots = settings.global["factorio-prometheus-exporter-export_logistic_stats"].value + options.enableMod = settings.global["factorio-metrics-exporter-enable"].value + options.enableProduction = settings.global["factorio-metrics-exporter-export_production_stats"].value + options.enablePollution = settings.global["factorio-metrics-exporter-export_pollution_stats"].value + options.enableFluid = settings.global["factorio-metrics-exporter-export_fluid_stats"].value + options.enablePlayers = settings.global["factorio-metrics-exporter-export_player_stats"].value + options.enableKills = settings.global["factorio-metrics-exporter-export_kill_stats"].value + options.enablePower = settings.global["factorio-metrics-exporter-export_power_stats"].value + options.enableResearch = settings.global["factorio-metrics-exporter-export_research_stats"].value + options.enableRobots = settings.global["factorio-metrics-exporter-export_logistic_stats"].value end) script.on_configuration_changed(function() @@ -78,42 +78,42 @@ end script.on_event(defines.events.on_runtime_mod_setting_changed, function(event) log("Mod setting changed: "..event.setting) - if event.setting == "factorio-prometheus-exporter-tick-interval" then - tickInterval = settings.global["factorio-prometheus-exporter-tick-interval"].value + if event.setting == "factorio-metrics-exporter-tick-interval" then + tickInterval = settings.global["factorio-metrics-exporter-tick-interval"].value end - if event.setting == "factorio-prometheus-exporter-enable" then - options.enableMod = settings.global["factorio-prometheus-exporter-enable"].value + if event.setting == "factorio-metrics-exporter-enable" then + options.enableMod = settings.global["factorio-metrics-exporter-enable"].value end - if event.setting == "factorio-prometheus-exporter-export_production_stats" then - options.enableProduction = settings.global["factorio-prometheus-exporter-export_production_stats"].value + if event.setting == "factorio-metrics-exporter-export_production_stats" then + options.enableProduction = settings.global["factorio-metrics-exporter-export_production_stats"].value end - if event.setting == "factorio-prometheus-exporter-export_fluid_stats" then - options.enableFluid = settings.global["factorio-prometheus-exporter-export_fluid_stats"].value + if event.setting == "factorio-metrics-exporter-export_fluid_stats" then + options.enableFluid = settings.global["factorio-metrics-exporter-export_fluid_stats"].value end - if event.setting == "factorio-prometheus-exporter-export_pollution_stats" then - options.enablePollution = settings.global["factorio-prometheus-exporter-export_pollution_stats"].value + if event.setting == "factorio-metrics-exporter-export_pollution_stats" then + options.enablePollution = settings.global["factorio-metrics-exporter-export_pollution_stats"].value end - if event.setting == "factorio-prometheus-exporter-export_power_stats" then - options.enablePower = settings.global["factorio-prometheus-exporter-export_power_stats"].value + if event.setting == "factorio-metrics-exporter-export_power_stats" then + options.enablePower = settings.global["factorio-metrics-exporter-export_power_stats"].value end - if event.setting == "factorio-prometheus-exporter-export_logistic_stats" then - options.enableRobots = settings.global["factorio-prometheus-exporter-export_logistic_stats"].value + if event.setting == "factorio-metrics-exporter-export_logistic_stats" then + options.enableRobots = settings.global["factorio-metrics-exporter-export_logistic_stats"].value end - if event.setting == "factorio-prometheus-exporter-export_player_stats" then - options.enablePlayers = settings.global["factorio-prometheus-exporter-export_player_stats"].value + if event.setting == "factorio-metrics-exporter-export_player_stats" then + options.enablePlayers = settings.global["factorio-metrics-exporter-export_player_stats"].value end - if event.setting == "factorio-prometheus-exporter-export_kill_stats" then - options.enableKills = settings.global["factorio-prometheus-exporter-export_kill_stats"].value + if event.setting == "factorio-metrics-exporter-export_kill_stats" then + options.enableKills = settings.global["factorio-metrics-exporter-export_kill_stats"].value end - if event.setting == "factorio-prometheus-exporter-export_research_stats" then - options.enableResearch = settings.global["factorio-prometheus-exporter-export_research_stats"].value + if event.setting == "factorio-metrics-exporter-export_research_stats" then + options.enableResearch = settings.global["factorio-metrics-exporter-export_research_stats"].value end end) diff --git a/factorio-prometheus-exporter_0.1.0.zip b/factorio-prometheus-exporter_0.1.0.zip new file mode 100644 index 0000000..0613629 Binary files /dev/null and b/factorio-prometheus-exporter_0.1.0.zip differ diff --git a/info.json b/info.json index 5f50e31..20476ce 100644 --- a/info.json +++ b/info.json @@ -1,7 +1,7 @@ { - "name": "factorio-prometheus-exporter", + "name": "factorio-metrics-exporter", "version": "0.1.0", - "title": "Prometheus Exporter", + "title": "Prometheus Metrics Exporter", "author": "Jan Grießhaber", "contact": "jan@griesshaber.systems", "homepage": "", @@ -14,6 +14,6 @@ "tags": [ "monitoring", "metrics", - "prometheus" + "metrics" ] } \ No newline at end of file diff --git a/locale/de-DE/locale.cfg b/locale/de-DE/locale.cfg index dfca58c..deda9df 100644 --- a/locale/de-DE/locale.cfg +++ b/locale/de-DE/locale.cfg @@ -1,6 +1,6 @@ [mod-setting-name] -factorio-prometheus-exporter-export_production_stats = Enable ProductionD -factorio-prometheus-exporter-export_logistic_stats=Enable LogisticsD -factorio-prometheus-exporter-export_pollution_stats=Enable PollutionD +factorio-metrics-exporter-export_production_stats = Enable ProductionD +factorio-metrics-exporter-export_logistic_stats=Enable LogisticsD +factorio-metrics-exporter-export_pollution_stats=Enable PollutionD [mod-setting-description] -factorio-prometheus-exporter-export_production_stats = Enables sending of the production statistics per surface. Not very expensive \ No newline at end of file +factorio-metrics-exporter-export_production_stats = Enables sending of the production statistics per surface. Not very expensive \ No newline at end of file diff --git a/locale/en/locale.cfg b/locale/en/locale.cfg index 4caac53..b3556ff 100644 --- a/locale/en/locale.cfg +++ b/locale/en/locale.cfg @@ -1,26 +1,26 @@ [mod-setting-name] -factorio-prometheus-exporter-enable=Enable Mod -factorio-prometheus-exporter-tick-interval=Tick Interval -factorio-prometheus-exporter-udp-address=UDP Port -factorio-prometheus-exporter-export_production_stats=Enable Production -factorio-prometheus-exporter-export_fluid_stats=Enable Fluids -factorio-prometheus-exporter-export_logistic_stats=Enable Logistics -factorio-prometheus-exporter-export_pollution_stats=Enable Pollution -factorio-prometheus-exporter-export_kill_stats=Enable Kills -factorio-prometheus-exporter-export_research_stats=Enable Research -factorio-prometheus-exporter-export_power_stats=Enable Power -factorio-prometheus-exporter-export_player_stats=Enable Player -factorio-prometheus-exporter-export_train_stats=Enable Train +factorio-metrics-exporter-enable=Enable Mod +factorio-metrics-exporter-tick-interval=Tick Interval +factorio-metrics-exporter-udp-address=UDP Port +factorio-metrics-exporter-export_production_stats=Enable Production +factorio-metrics-exporter-export_fluid_stats=Enable Fluids +factorio-metrics-exporter-export_logistic_stats=Enable Logistics +factorio-metrics-exporter-export_pollution_stats=Enable Pollution +factorio-metrics-exporter-export_kill_stats=Enable Kills +factorio-metrics-exporter-export_research_stats=Enable Research +factorio-metrics-exporter-export_power_stats=Enable Power +factorio-metrics-exporter-export_player_stats=Enable Player +factorio-metrics-exporter-export_train_stats=Enable Train [mod-setting-description] -factorio-prometheus-exporter-export_production_stats=Enables sending of the production statistics per surface. Not very expensive -factorio-prometheus-exporter-enable=Enable sending of the UDP packets -factorio-prometheus-exporter-tick-interval=Set the tick interval at which metrics are collected -factorio-prometheus-exporter-udp-address=Choose a udp port to send the data to, must be enable with --enable-lua-udp when starting factorio. It is important to use a different port the target port! -factorio-prometheus-exporter-export_fluid_stats=Enables the sending of fluid production statistics. Not very expensive -factorio-prometheus-exporter-export_logistic_stats=Enables sending of logistic network statistics. Moderatly expensive -factorio-prometheus-exporter-export_pollution_stats=Enable sending of Pollution related statistics. Not very expensive -factorio-prometheus-exporter-export_kill_stats=Enable sending of kill statistics. Not very expensive -factorio-prometheus-exporter-export_research_stats=Enable sending of research statistics. Moderatly expensive -factorio-prometheus-exporter-export_power_stats=Enable Power. Not yet implemented! -factorio-prometheus-exporter-export_player_stats=Enable sending of player statistics -factorio-prometheus-exporter-export_train_stats=Enable sending of train statistics. Not yet implemented! \ No newline at end of file +factorio-metrics-exporter-export_production_stats=Enables sending of the production statistics per surface. Not very expensive +factorio-metrics-exporter-enable=Enable sending of the UDP packets +factorio-metrics-exporter-tick-interval=Set the tick interval at which metrics are collected +factorio-metrics-exporter-udp-address=Choose a udp port to send the data to, must be enable with --enable-lua-udp when starting factorio. It is important to use a different port the target port! +factorio-metrics-exporter-export_fluid_stats=Enables the sending of fluid production statistics. Not very expensive +factorio-metrics-exporter-export_logistic_stats=Enables sending of logistic network statistics. Moderatly expensive +factorio-metrics-exporter-export_pollution_stats=Enable sending of Pollution related statistics. Not very expensive +factorio-metrics-exporter-export_kill_stats=Enable sending of kill statistics. Not very expensive +factorio-metrics-exporter-export_research_stats=Enable sending of research statistics. Moderatly expensive +factorio-metrics-exporter-export_power_stats=Enable Power. Not yet implemented! +factorio-metrics-exporter-export_player_stats=Enable sending of player statistics +factorio-metrics-exporter-export_train_stats=Enable sending of train statistics. Not yet implemented! \ No newline at end of file diff --git a/settings.lua b/settings.lua index 6868579..fe3af8d 100644 --- a/settings.lua +++ b/settings.lua @@ -1,7 +1,7 @@ data:extend({ { type = "int-setting", - name = "factorio-prometheus-exporter-tick-interval", + name = "factorio-metrics-exporter-tick-interval", setting_type = "runtime-global", minimum_value = 60, default_value = 300, @@ -9,14 +9,14 @@ data:extend({ }, { type = "bool-setting", - name = "factorio-prometheus-exporter-enable", + name = "factorio-metrics-exporter-enable", setting_type = "runtime-global", default_value = true, order = "a" }, { type = "int-setting", - name = "factorio-prometheus-exporter-udp-port", + name = "factorio-metrics-exporter-udp-port", setting_type = "startup", allow_blank = false, default_value = 52555, @@ -24,63 +24,63 @@ data:extend({ }, { type = "bool-setting", - name = "factorio-prometheus-exporter-export_production_stats", + name = "factorio-metrics-exporter-export_production_stats", setting_type = "runtime-global", default_value = true, order = "d" }, { type = "bool-setting", - name = "factorio-prometheus-exporter-export_player_stats", + name = "factorio-metrics-exporter-export_player_stats", setting_type = "runtime-global", default_value = true, order = "e" }, { type = "bool-setting", - name = "factorio-prometheus-exporter-export_fluid_stats", + name = "factorio-metrics-exporter-export_fluid_stats", setting_type = "runtime-global", default_value = true, order = "f" }, { type = "bool-setting", - name = "factorio-prometheus-exporter-export_power_stats", + name = "factorio-metrics-exporter-export_power_stats", setting_type = "runtime-global", default_value = false, order = "g" }, { type = "bool-setting", - name = "factorio-prometheus-exporter-export_pollution_stats", + name = "factorio-metrics-exporter-export_pollution_stats", setting_type = "runtime-global", default_value = true, order = "h" }, { type = "bool-setting", - name = "factorio-prometheus-exporter-export_kill_stats", + name = "factorio-metrics-exporter-export_kill_stats", setting_type = "runtime-global", default_value = true, order = "h" }, { type = "bool-setting", - name = "factorio-prometheus-exporter-export_research_stats", + name = "factorio-metrics-exporter-export_research_stats", setting_type = "runtime-global", default_value = true, order = "i" }, { type = "bool-setting", - name = "factorio-prometheus-exporter-export_logistic_stats", + name = "factorio-metrics-exporter-export_logistic_stats", setting_type = "runtime-global", default_value = true, order = "i" }, { type = "bool-setting", - name = "factorio-prometheus-exporter-export_train_stats", + name = "factorio-metrics-exporter-export_train_stats", setting_type = "runtime-global", default_value = true, order = "i"