summaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2024-03-15 00:42:10 +0100
committerChristian Pointner <equinox@spreadspace.org>2024-03-15 00:42:10 +0100
commit439686f8c19854103557f01ea31c7135e6b134d5 (patch)
tree2010f4470f23cc1bc384fe083fc7cf6fd95b75db /files
parentupdate all standalone kubelets to 1.29.2 (diff)
upgraded some prometheus components
Diffstat (limited to 'files')
-rw-r--r--files/common/openwrt/chrony_prometheus-node-exporter.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/files/common/openwrt/chrony_prometheus-node-exporter.lua b/files/common/openwrt/chrony_prometheus-node-exporter.lua
index a3c4b292..0e4271c1 100644
--- a/files/common/openwrt/chrony_prometheus-node-exporter.lua
+++ b/files/common/openwrt/chrony_prometheus-node-exporter.lua
@@ -4,6 +4,7 @@
local chrony_sources_cmd = 'chronyc -n -c sources'
local chrony_tracking_cmd = 'chronyc -n -c tracking'
+local chrony_serverstats_cmd = 'chronyc -n -c serverstats'
local source_states = {}
source_states['*'] = "sync"
@@ -44,6 +45,7 @@ end
local function scrape()
local chrony_tracking = get_cmdoutput(chrony_tracking_cmd)
local chrony_sources = get_cmdoutput(chrony_sources_cmd)
+ local chrony_serverstats = get_cmdoutput(chrony_serverstats_cmd)
local metric_up = metric("chrony_up", "gauge")
if chrony_tracking == nil or chrony_sources == nil then
@@ -98,6 +100,21 @@ local function scrape()
local items = comma_split(line)
metric_sources_stratum({ source_address = items[3], source_name = items[3] }, tonumber(items[4]))
end
+
+ for _, line in ipairs(chrony_serverstats) do
+ local items = comma_split(line)
+ metric("chrony_serverstats_ntp_packets_received_total", "counter", nil, tonumber(items[1]))
+ metric("chrony_serverstats_nts_ke_connections_accepted_total", "counter", nil, tonumber(items[6]))
+ metric("chrony_serverstats_command_packets_received_total", "counter", nil, tonumber(items[3]))
+ metric("chrony_serverstats_ntp_packets_dropped_total", "counter", nil, tonumber(items[2]))
+ metric("chrony_serverstats_nts_ke_connections_dropped_total", "counter", nil, tonumber(items[7]))
+ metric("chrony_serverstats_command_packets_dropped_total", "counter", nil, tonumber(items[4]))
+ metric("chrony_serverstats_client_log_records_dropped_total", "counter", nil, tonumber(items[5]))
+ metric("chrony_serverstats_authenticated_ntp_packets_total", "counter", nil, tonumber(items[8]))
+ metric("chrony_serverstats_interleaved_ntp_packets_total", "counter", nil, tonumber(items[9]))
+ metric("chrony_serverstats_ntp_timestamps_held", "gauge", nil, tonumber(items[10]))
+ metric("chrony_serverstats_ntp_timestamp_span_seconds", "gauge", nil, tonumber(items[11]))
+ end
end
return { scrape = scrape }