Private
Public Access
1
0

Changed Mod Name to avoid collision

This commit is contained in:
Jan Grießhaber
2026-01-02 10:26:50 +01:00
parent 09b7ec8742
commit 5fd30dc85b
6 changed files with 84 additions and 84 deletions

View File

@@ -5,8 +5,8 @@ require("research-stats")
require("power-stats") require("power-stats")
require("logistic-network-stats") require("logistic-network-stats")
tickInterval = tonumber(settings.global["factorio-prometheus-exporter-tick-interval"].value) or 300 tickInterval = tonumber(settings.global["factorio-metrics-exporter-tick-interval"].value) or 300
udpAddress = tonumber(settings.startup["factorio-prometheus-exporter-udp-address"].value) or 52555 udpAddress = tonumber(settings.startup["factorio-metrics-exporter-udp-address"].value) or 52555
isInitialized = false isInitialized = false
sendIndex = 0 sendIndex = 0
@@ -34,33 +34,33 @@ script.on_init(function ()
storage.labs = {} storage.labs = {}
sendIndex = 0 sendIndex = 0
options.enableMod = settings.global["factorio-prometheus-exporter-enable"].value options.enableMod = settings.global["factorio-metrics-exporter-enable"].value
options.enableProduction = settings.global["factorio-prometheus-exporter-export_production_stats"].value options.enableProduction = settings.global["factorio-metrics-exporter-export_production_stats"].value
options.enablePollution = settings.global["factorio-prometheus-exporter-export_pollution_stats"].value options.enablePollution = settings.global["factorio-metrics-exporter-export_pollution_stats"].value
options.enableFluid = settings.global["factorio-prometheus-exporter-export_fluid_stats"].value options.enableFluid = settings.global["factorio-metrics-exporter-export_fluid_stats"].value
options.enablePlayers = settings.global["factorio-prometheus-exporter-export_player_stats"].value options.enablePlayers = settings.global["factorio-metrics-exporter-export_player_stats"].value
options.enableKills = settings.global["factorio-prometheus-exporter-export_kill_stats"].value options.enableKills = settings.global["factorio-metrics-exporter-export_kill_stats"].value
options.enablePower = settings.global["factorio-prometheus-exporter-export_power_stats"].value options.enablePower = settings.global["factorio-metrics-exporter-export_power_stats"].value
options.enableResearch = settings.global["factorio-prometheus-exporter-export_research_stats"].value options.enableResearch = settings.global["factorio-metrics-exporter-export_research_stats"].value
options.enableRobots = settings.global["factorio-prometheus-exporter-export_logistic_stats"].value options.enableRobots = settings.global["factorio-metrics-exporter-export_logistic_stats"].value
end) end)
script.on_load(function () script.on_load(function ()
log("factorio-prometheus-exporter: on_load") log("factorio-metrics-exporter: on_load")
log("tickInterval: "..tickInterval) log("tickInterval: "..tickInterval)
log("udpAddress: "..udpAddress) log("udpAddress: "..udpAddress)
options.enableMod = settings.global["factorio-prometheus-exporter-enable"].value options.enableMod = settings.global["factorio-metrics-exporter-enable"].value
options.enableProduction = settings.global["factorio-prometheus-exporter-export_production_stats"].value options.enableProduction = settings.global["factorio-metrics-exporter-export_production_stats"].value
options.enablePollution = settings.global["factorio-prometheus-exporter-export_pollution_stats"].value options.enablePollution = settings.global["factorio-metrics-exporter-export_pollution_stats"].value
options.enableFluid = settings.global["factorio-prometheus-exporter-export_fluid_stats"].value options.enableFluid = settings.global["factorio-metrics-exporter-export_fluid_stats"].value
options.enablePlayers = settings.global["factorio-prometheus-exporter-export_player_stats"].value options.enablePlayers = settings.global["factorio-metrics-exporter-export_player_stats"].value
options.enableKills = settings.global["factorio-prometheus-exporter-export_kill_stats"].value options.enableKills = settings.global["factorio-metrics-exporter-export_kill_stats"].value
options.enablePower = settings.global["factorio-prometheus-exporter-export_power_stats"].value options.enablePower = settings.global["factorio-metrics-exporter-export_power_stats"].value
options.enableResearch = settings.global["factorio-prometheus-exporter-export_research_stats"].value options.enableResearch = settings.global["factorio-metrics-exporter-export_research_stats"].value
options.enableRobots = settings.global["factorio-prometheus-exporter-export_logistic_stats"].value options.enableRobots = settings.global["factorio-metrics-exporter-export_logistic_stats"].value
end) end)
script.on_configuration_changed(function() script.on_configuration_changed(function()
@@ -78,42 +78,42 @@ end
script.on_event(defines.events.on_runtime_mod_setting_changed, function(event) script.on_event(defines.events.on_runtime_mod_setting_changed, function(event)
log("Mod setting changed: "..event.setting) log("Mod setting changed: "..event.setting)
if event.setting == "factorio-prometheus-exporter-tick-interval" then if event.setting == "factorio-metrics-exporter-tick-interval" then
tickInterval = settings.global["factorio-prometheus-exporter-tick-interval"].value tickInterval = settings.global["factorio-metrics-exporter-tick-interval"].value
end end
if event.setting == "factorio-prometheus-exporter-enable" then if event.setting == "factorio-metrics-exporter-enable" then
options.enableMod = settings.global["factorio-prometheus-exporter-enable"].value options.enableMod = settings.global["factorio-metrics-exporter-enable"].value
end end
if event.setting == "factorio-prometheus-exporter-export_production_stats" then if event.setting == "factorio-metrics-exporter-export_production_stats" then
options.enableProduction = settings.global["factorio-prometheus-exporter-export_production_stats"].value options.enableProduction = settings.global["factorio-metrics-exporter-export_production_stats"].value
end end
if event.setting == "factorio-prometheus-exporter-export_fluid_stats" then if event.setting == "factorio-metrics-exporter-export_fluid_stats" then
options.enableFluid = settings.global["factorio-prometheus-exporter-export_fluid_stats"].value options.enableFluid = settings.global["factorio-metrics-exporter-export_fluid_stats"].value
end end
if event.setting == "factorio-prometheus-exporter-export_pollution_stats" then if event.setting == "factorio-metrics-exporter-export_pollution_stats" then
options.enablePollution = settings.global["factorio-prometheus-exporter-export_pollution_stats"].value options.enablePollution = settings.global["factorio-metrics-exporter-export_pollution_stats"].value
end end
if event.setting == "factorio-prometheus-exporter-export_power_stats" then if event.setting == "factorio-metrics-exporter-export_power_stats" then
options.enablePower = settings.global["factorio-prometheus-exporter-export_power_stats"].value options.enablePower = settings.global["factorio-metrics-exporter-export_power_stats"].value
end end
if event.setting == "factorio-prometheus-exporter-export_logistic_stats" then if event.setting == "factorio-metrics-exporter-export_logistic_stats" then
options.enableRobots = settings.global["factorio-prometheus-exporter-export_logistic_stats"].value options.enableRobots = settings.global["factorio-metrics-exporter-export_logistic_stats"].value
end end
if event.setting == "factorio-prometheus-exporter-export_player_stats" then if event.setting == "factorio-metrics-exporter-export_player_stats" then
options.enablePlayers = settings.global["factorio-prometheus-exporter-export_player_stats"].value options.enablePlayers = settings.global["factorio-metrics-exporter-export_player_stats"].value
end end
if event.setting == "factorio-prometheus-exporter-export_kill_stats" then if event.setting == "factorio-metrics-exporter-export_kill_stats" then
options.enableKills = settings.global["factorio-prometheus-exporter-export_kill_stats"].value options.enableKills = settings.global["factorio-metrics-exporter-export_kill_stats"].value
end end
if event.setting == "factorio-prometheus-exporter-export_research_stats" then if event.setting == "factorio-metrics-exporter-export_research_stats" then
options.enableResearch = settings.global["factorio-prometheus-exporter-export_research_stats"].value options.enableResearch = settings.global["factorio-metrics-exporter-export_research_stats"].value
end end
end) end)

Binary file not shown.

View File

@@ -1,7 +1,7 @@
{ {
"name": "factorio-prometheus-exporter", "name": "factorio-metrics-exporter",
"version": "0.1.0", "version": "0.1.0",
"title": "Prometheus Exporter", "title": "Prometheus Metrics Exporter",
"author": "Jan Grießhaber", "author": "Jan Grießhaber",
"contact": "jan@griesshaber.systems", "contact": "jan@griesshaber.systems",
"homepage": "", "homepage": "",
@@ -14,6 +14,6 @@
"tags": [ "tags": [
"monitoring", "monitoring",
"metrics", "metrics",
"prometheus" "metrics"
] ]
} }

View File

@@ -1,6 +1,6 @@
[mod-setting-name] [mod-setting-name]
factorio-prometheus-exporter-export_production_stats = Enable ProductionD factorio-metrics-exporter-export_production_stats = Enable ProductionD
factorio-prometheus-exporter-export_logistic_stats=Enable LogisticsD factorio-metrics-exporter-export_logistic_stats=Enable LogisticsD
factorio-prometheus-exporter-export_pollution_stats=Enable PollutionD factorio-metrics-exporter-export_pollution_stats=Enable PollutionD
[mod-setting-description] [mod-setting-description]
factorio-prometheus-exporter-export_production_stats = Enables sending of the production statistics per surface. Not very expensive factorio-metrics-exporter-export_production_stats = Enables sending of the production statistics per surface. Not very expensive

View File

@@ -1,26 +1,26 @@
[mod-setting-name] [mod-setting-name]
factorio-prometheus-exporter-enable=Enable Mod factorio-metrics-exporter-enable=Enable Mod
factorio-prometheus-exporter-tick-interval=Tick Interval factorio-metrics-exporter-tick-interval=Tick Interval
factorio-prometheus-exporter-udp-address=UDP Port factorio-metrics-exporter-udp-address=UDP Port
factorio-prometheus-exporter-export_production_stats=Enable Production factorio-metrics-exporter-export_production_stats=Enable Production
factorio-prometheus-exporter-export_fluid_stats=Enable Fluids factorio-metrics-exporter-export_fluid_stats=Enable Fluids
factorio-prometheus-exporter-export_logistic_stats=Enable Logistics factorio-metrics-exporter-export_logistic_stats=Enable Logistics
factorio-prometheus-exporter-export_pollution_stats=Enable Pollution factorio-metrics-exporter-export_pollution_stats=Enable Pollution
factorio-prometheus-exporter-export_kill_stats=Enable Kills factorio-metrics-exporter-export_kill_stats=Enable Kills
factorio-prometheus-exporter-export_research_stats=Enable Research factorio-metrics-exporter-export_research_stats=Enable Research
factorio-prometheus-exporter-export_power_stats=Enable Power factorio-metrics-exporter-export_power_stats=Enable Power
factorio-prometheus-exporter-export_player_stats=Enable Player factorio-metrics-exporter-export_player_stats=Enable Player
factorio-prometheus-exporter-export_train_stats=Enable Train factorio-metrics-exporter-export_train_stats=Enable Train
[mod-setting-description] [mod-setting-description]
factorio-prometheus-exporter-export_production_stats=Enables sending of the production statistics per surface. Not very expensive factorio-metrics-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-metrics-exporter-enable=Enable sending of the UDP packets
factorio-prometheus-exporter-tick-interval=Set the tick interval at which metrics are collected factorio-metrics-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 <sending_port> when starting factorio. It is important to use a different port the target port! factorio-metrics-exporter-udp-address=Choose a udp port to send the data to, must be enable with --enable-lua-udp <sending_port> 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-metrics-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-metrics-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-metrics-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-metrics-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-metrics-exporter-export_research_stats=Enable sending of research statistics. Moderatly expensive
factorio-prometheus-exporter-export_power_stats=Enable Power. Not yet implemented! factorio-metrics-exporter-export_power_stats=Enable Power. Not yet implemented!
factorio-prometheus-exporter-export_player_stats=Enable sending of player statistics factorio-metrics-exporter-export_player_stats=Enable sending of player statistics
factorio-prometheus-exporter-export_train_stats=Enable sending of train statistics. Not yet implemented! factorio-metrics-exporter-export_train_stats=Enable sending of train statistics. Not yet implemented!

View File

@@ -1,7 +1,7 @@
data:extend({ data:extend({
{ {
type = "int-setting", type = "int-setting",
name = "factorio-prometheus-exporter-tick-interval", name = "factorio-metrics-exporter-tick-interval",
setting_type = "runtime-global", setting_type = "runtime-global",
minimum_value = 60, minimum_value = 60,
default_value = 300, default_value = 300,
@@ -9,14 +9,14 @@ data:extend({
}, },
{ {
type = "bool-setting", type = "bool-setting",
name = "factorio-prometheus-exporter-enable", name = "factorio-metrics-exporter-enable",
setting_type = "runtime-global", setting_type = "runtime-global",
default_value = true, default_value = true,
order = "a" order = "a"
}, },
{ {
type = "int-setting", type = "int-setting",
name = "factorio-prometheus-exporter-udp-port", name = "factorio-metrics-exporter-udp-port",
setting_type = "startup", setting_type = "startup",
allow_blank = false, allow_blank = false,
default_value = 52555, default_value = 52555,
@@ -24,63 +24,63 @@ data:extend({
}, },
{ {
type = "bool-setting", type = "bool-setting",
name = "factorio-prometheus-exporter-export_production_stats", name = "factorio-metrics-exporter-export_production_stats",
setting_type = "runtime-global", setting_type = "runtime-global",
default_value = true, default_value = true,
order = "d" order = "d"
}, },
{ {
type = "bool-setting", type = "bool-setting",
name = "factorio-prometheus-exporter-export_player_stats", name = "factorio-metrics-exporter-export_player_stats",
setting_type = "runtime-global", setting_type = "runtime-global",
default_value = true, default_value = true,
order = "e" order = "e"
}, },
{ {
type = "bool-setting", type = "bool-setting",
name = "factorio-prometheus-exporter-export_fluid_stats", name = "factorio-metrics-exporter-export_fluid_stats",
setting_type = "runtime-global", setting_type = "runtime-global",
default_value = true, default_value = true,
order = "f" order = "f"
}, },
{ {
type = "bool-setting", type = "bool-setting",
name = "factorio-prometheus-exporter-export_power_stats", name = "factorio-metrics-exporter-export_power_stats",
setting_type = "runtime-global", setting_type = "runtime-global",
default_value = false, default_value = false,
order = "g" order = "g"
}, },
{ {
type = "bool-setting", type = "bool-setting",
name = "factorio-prometheus-exporter-export_pollution_stats", name = "factorio-metrics-exporter-export_pollution_stats",
setting_type = "runtime-global", setting_type = "runtime-global",
default_value = true, default_value = true,
order = "h" order = "h"
}, },
{ {
type = "bool-setting", type = "bool-setting",
name = "factorio-prometheus-exporter-export_kill_stats", name = "factorio-metrics-exporter-export_kill_stats",
setting_type = "runtime-global", setting_type = "runtime-global",
default_value = true, default_value = true,
order = "h" order = "h"
}, },
{ {
type = "bool-setting", type = "bool-setting",
name = "factorio-prometheus-exporter-export_research_stats", name = "factorio-metrics-exporter-export_research_stats",
setting_type = "runtime-global", setting_type = "runtime-global",
default_value = true, default_value = true,
order = "i" order = "i"
}, },
{ {
type = "bool-setting", type = "bool-setting",
name = "factorio-prometheus-exporter-export_logistic_stats", name = "factorio-metrics-exporter-export_logistic_stats",
setting_type = "runtime-global", setting_type = "runtime-global",
default_value = true, default_value = true,
order = "i" order = "i"
}, },
{ {
type = "bool-setting", type = "bool-setting",
name = "factorio-prometheus-exporter-export_train_stats", name = "factorio-metrics-exporter-export_train_stats",
setting_type = "runtime-global", setting_type = "runtime-global",
default_value = true, default_value = true,
order = "i" order = "i"