From 9514ff1a2fff5af2bd3c34854835b371ca7c2952 Mon Sep 17 00:00:00 2001 From: Aprazors Date: Fri, 20 Mar 2026 15:02:04 -0500 Subject: [PATCH 1/2] fix: correct swapped min/max metric names in vdom-resource The min_guaranteed_value map key was mapped to the _max_value metric name and vice versa. Any dashboard using these metrics silently showed inverted values. Signed-off-by: Aprazors --- pkg/probe/system_vdom-resource.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/probe/system_vdom-resource.go b/pkg/probe/system_vdom-resource.go index 7f12090..8e81e5b 100644 --- a/pkg/probe/system_vdom-resource.go +++ b/pkg/probe/system_vdom-resource.go @@ -69,12 +69,12 @@ func probeSystemVdomResource(c fortigatehttpclient.FortiHTTP, _ *TargetMetadata) []string{"vdom", "object"}, nil, ) vdomDesc["min_guaranteed_value"] = prometheus.NewDesc( - "fortigate_vdom_resource_object_guaranteed_max_value", + "fortigate_vdom_resource_object_guaranteed_min_value", "Object Minimum guaranteed value", []string{"vdom", "object"}, nil, ) vdomDesc["max_guaranteed_value"] = prometheus.NewDesc( - "fortigate_vdom_resource_object_guaranteed_min_value", + "fortigate_vdom_resource_object_guaranteed_max_value", "Object Maximum guaranteed value", []string{"vdom", "object"}, nil, ) From 3a533d973c9c3b4fb212e4c78d77bc6214cf8ccb Mon Sep 17 00:00:00 2001 From: Aprazors Date: Sun, 22 Mar 2026 21:04:54 -0500 Subject: [PATCH 2/2] fix: update test golden output for corrected min/max metric names Per reviewer feedback, update the test expected output to match the corrected metric name mapping. Signed-off-by: Aprazors --- pkg/probe/system_vdom-resource_test.go | 130 ++++++++++++------------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/pkg/probe/system_vdom-resource_test.go b/pkg/probe/system_vdom-resource_test.go index 57d8c10..feab166 100644 --- a/pkg/probe/system_vdom-resource_test.go +++ b/pkg/probe/system_vdom-resource_test.go @@ -270,82 +270,82 @@ func TestVdomResource(t *testing.T) { fortigate_vdom_resource_object_guaranteed{object="user",vdom="kalle-test"} 0 fortigate_vdom_resource_object_guaranteed{object="user-group",vdom="gur-proddmzext"} 0 fortigate_vdom_resource_object_guaranteed{object="user-group",vdom="kalle-test"} 0 - # HELP fortigate_vdom_resource_object_guaranteed_max_value Object Minimum guaranteed value - # TYPE fortigate_vdom_resource_object_guaranteed_max_value gauge - fortigate_vdom_resource_object_guaranteed_max_value{object="custom-service",vdom="gur-proddmzext"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="custom-service",vdom="kalle-test"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="dialup-tunnel",vdom="gur-proddmzext"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="dialup-tunnel",vdom="kalle-test"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="firewall-address",vdom="gur-proddmzext"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="firewall-address",vdom="kalle-test"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="firewall-addrgrp",vdom="gur-proddmzext"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="firewall-addrgrp",vdom="kalle-test"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="firewall-policy",vdom="gur-proddmzext"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="firewall-policy",vdom="kalle-test"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="ipsec-phase1",vdom="gur-proddmzext"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="ipsec-phase1",vdom="kalle-test"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="ipsec-phase1-interface",vdom="gur-proddmzext"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="ipsec-phase1-interface",vdom="kalle-test"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="ipsec-phase2",vdom="gur-proddmzext"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="ipsec-phase2",vdom="kalle-test"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="ipsec-phase2-interface",vdom="gur-proddmzext"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="ipsec-phase2-interface",vdom="kalle-test"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="log-disk-quota",vdom="gur-proddmzext"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="log-disk-quota",vdom="kalle-test"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="onetime-schedule",vdom="gur-proddmzext"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="onetime-schedule",vdom="kalle-test"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="proxy",vdom="gur-proddmzext"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="proxy",vdom="kalle-test"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="recurring-schedule",vdom="gur-proddmzext"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="recurring-schedule",vdom="kalle-test"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="service-group",vdom="gur-proddmzext"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="service-group",vdom="kalle-test"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="session",vdom="gur-proddmzext"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="session",vdom="kalle-test"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="sslvpn",vdom="gur-proddmzext"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="sslvpn",vdom="kalle-test"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="user",vdom="gur-proddmzext"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="user",vdom="kalle-test"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="user-group",vdom="gur-proddmzext"} 0 - fortigate_vdom_resource_object_guaranteed_max_value{object="user-group",vdom="kalle-test"} 0 - # HELP fortigate_vdom_resource_object_guaranteed_min_value Object Maximum guaranteed value + # HELP fortigate_vdom_resource_object_guaranteed_min_value Object Minimum guaranteed value # TYPE fortigate_vdom_resource_object_guaranteed_min_value gauge - fortigate_vdom_resource_object_guaranteed_min_value{object="custom-service",vdom="gur-proddmzext"} 10240 - fortigate_vdom_resource_object_guaranteed_min_value{object="custom-service",vdom="kalle-test"} 10240 + fortigate_vdom_resource_object_guaranteed_min_value{object="custom-service",vdom="gur-proddmzext"} 0 + fortigate_vdom_resource_object_guaranteed_min_value{object="custom-service",vdom="kalle-test"} 0 fortigate_vdom_resource_object_guaranteed_min_value{object="dialup-tunnel",vdom="gur-proddmzext"} 0 fortigate_vdom_resource_object_guaranteed_min_value{object="dialup-tunnel",vdom="kalle-test"} 0 - fortigate_vdom_resource_object_guaranteed_min_value{object="firewall-address",vdom="gur-proddmzext"} 198094 - fortigate_vdom_resource_object_guaranteed_min_value{object="firewall-address",vdom="kalle-test"} 198090 - fortigate_vdom_resource_object_guaranteed_min_value{object="firewall-addrgrp",vdom="gur-proddmzext"} 33189 - fortigate_vdom_resource_object_guaranteed_min_value{object="firewall-addrgrp",vdom="kalle-test"} 33188 - fortigate_vdom_resource_object_guaranteed_min_value{object="firewall-policy",vdom="gur-proddmzext"} 201009 - fortigate_vdom_resource_object_guaranteed_min_value{object="firewall-policy",vdom="kalle-test"} 201007 - fortigate_vdom_resource_object_guaranteed_min_value{object="ipsec-phase1",vdom="gur-proddmzext"} 20000 - fortigate_vdom_resource_object_guaranteed_min_value{object="ipsec-phase1",vdom="kalle-test"} 20000 + fortigate_vdom_resource_object_guaranteed_min_value{object="firewall-address",vdom="gur-proddmzext"} 0 + fortigate_vdom_resource_object_guaranteed_min_value{object="firewall-address",vdom="kalle-test"} 0 + fortigate_vdom_resource_object_guaranteed_min_value{object="firewall-addrgrp",vdom="gur-proddmzext"} 0 + fortigate_vdom_resource_object_guaranteed_min_value{object="firewall-addrgrp",vdom="kalle-test"} 0 + fortigate_vdom_resource_object_guaranteed_min_value{object="firewall-policy",vdom="gur-proddmzext"} 0 + fortigate_vdom_resource_object_guaranteed_min_value{object="firewall-policy",vdom="kalle-test"} 0 + fortigate_vdom_resource_object_guaranteed_min_value{object="ipsec-phase1",vdom="gur-proddmzext"} 0 + fortigate_vdom_resource_object_guaranteed_min_value{object="ipsec-phase1",vdom="kalle-test"} 0 fortigate_vdom_resource_object_guaranteed_min_value{object="ipsec-phase1-interface",vdom="gur-proddmzext"} 0 fortigate_vdom_resource_object_guaranteed_min_value{object="ipsec-phase1-interface",vdom="kalle-test"} 0 - fortigate_vdom_resource_object_guaranteed_min_value{object="ipsec-phase2",vdom="gur-proddmzext"} 20000 - fortigate_vdom_resource_object_guaranteed_min_value{object="ipsec-phase2",vdom="kalle-test"} 20000 + fortigate_vdom_resource_object_guaranteed_min_value{object="ipsec-phase2",vdom="gur-proddmzext"} 0 + fortigate_vdom_resource_object_guaranteed_min_value{object="ipsec-phase2",vdom="kalle-test"} 0 fortigate_vdom_resource_object_guaranteed_min_value{object="ipsec-phase2-interface",vdom="gur-proddmzext"} 0 fortigate_vdom_resource_object_guaranteed_min_value{object="ipsec-phase2-interface",vdom="kalle-test"} 0 fortigate_vdom_resource_object_guaranteed_min_value{object="log-disk-quota",vdom="gur-proddmzext"} 0 fortigate_vdom_resource_object_guaranteed_min_value{object="log-disk-quota",vdom="kalle-test"} 0 - fortigate_vdom_resource_object_guaranteed_min_value{object="onetime-schedule",vdom="gur-proddmzext"} 5000 - fortigate_vdom_resource_object_guaranteed_min_value{object="onetime-schedule",vdom="kalle-test"} 5000 - fortigate_vdom_resource_object_guaranteed_min_value{object="proxy",vdom="gur-proddmzext"} 64000 - fortigate_vdom_resource_object_guaranteed_min_value{object="proxy",vdom="kalle-test"} 64000 - fortigate_vdom_resource_object_guaranteed_min_value{object="recurring-schedule",vdom="gur-proddmzext"} 1024 - fortigate_vdom_resource_object_guaranteed_min_value{object="recurring-schedule",vdom="kalle-test"} 1024 - fortigate_vdom_resource_object_guaranteed_min_value{object="service-group",vdom="gur-proddmzext"} 4000 - fortigate_vdom_resource_object_guaranteed_min_value{object="service-group",vdom="kalle-test"} 4000 - fortigate_vdom_resource_object_guaranteed_min_value{object="session",vdom="gur-proddmzext"} 200000 - fortigate_vdom_resource_object_guaranteed_min_value{object="session",vdom="kalle-test"} 2.165e+07 + fortigate_vdom_resource_object_guaranteed_min_value{object="onetime-schedule",vdom="gur-proddmzext"} 0 + fortigate_vdom_resource_object_guaranteed_min_value{object="onetime-schedule",vdom="kalle-test"} 0 + fortigate_vdom_resource_object_guaranteed_min_value{object="proxy",vdom="gur-proddmzext"} 0 + fortigate_vdom_resource_object_guaranteed_min_value{object="proxy",vdom="kalle-test"} 0 + fortigate_vdom_resource_object_guaranteed_min_value{object="recurring-schedule",vdom="gur-proddmzext"} 0 + fortigate_vdom_resource_object_guaranteed_min_value{object="recurring-schedule",vdom="kalle-test"} 0 + fortigate_vdom_resource_object_guaranteed_min_value{object="service-group",vdom="gur-proddmzext"} 0 + fortigate_vdom_resource_object_guaranteed_min_value{object="service-group",vdom="kalle-test"} 0 + fortigate_vdom_resource_object_guaranteed_min_value{object="session",vdom="gur-proddmzext"} 0 + fortigate_vdom_resource_object_guaranteed_min_value{object="session",vdom="kalle-test"} 0 fortigate_vdom_resource_object_guaranteed_min_value{object="sslvpn",vdom="gur-proddmzext"} 0 fortigate_vdom_resource_object_guaranteed_min_value{object="sslvpn",vdom="kalle-test"} 0 - fortigate_vdom_resource_object_guaranteed_min_value{object="user",vdom="gur-proddmzext"} 5000 - fortigate_vdom_resource_object_guaranteed_min_value{object="user",vdom="kalle-test"} 5000 - fortigate_vdom_resource_object_guaranteed_min_value{object="user-group",vdom="gur-proddmzext"} 2000 - fortigate_vdom_resource_object_guaranteed_min_value{object="user-group",vdom="kalle-test"} 2000 + fortigate_vdom_resource_object_guaranteed_min_value{object="user",vdom="gur-proddmzext"} 0 + fortigate_vdom_resource_object_guaranteed_min_value{object="user",vdom="kalle-test"} 0 + fortigate_vdom_resource_object_guaranteed_min_value{object="user-group",vdom="gur-proddmzext"} 0 + fortigate_vdom_resource_object_guaranteed_min_value{object="user-group",vdom="kalle-test"} 0 + # HELP fortigate_vdom_resource_object_guaranteed_max_value Object Maximum guaranteed value + # TYPE fortigate_vdom_resource_object_guaranteed_max_value gauge + fortigate_vdom_resource_object_guaranteed_max_value{object="custom-service",vdom="gur-proddmzext"} 10240 + fortigate_vdom_resource_object_guaranteed_max_value{object="custom-service",vdom="kalle-test"} 10240 + fortigate_vdom_resource_object_guaranteed_max_value{object="dialup-tunnel",vdom="gur-proddmzext"} 0 + fortigate_vdom_resource_object_guaranteed_max_value{object="dialup-tunnel",vdom="kalle-test"} 0 + fortigate_vdom_resource_object_guaranteed_max_value{object="firewall-address",vdom="gur-proddmzext"} 198094 + fortigate_vdom_resource_object_guaranteed_max_value{object="firewall-address",vdom="kalle-test"} 198090 + fortigate_vdom_resource_object_guaranteed_max_value{object="firewall-addrgrp",vdom="gur-proddmzext"} 33189 + fortigate_vdom_resource_object_guaranteed_max_value{object="firewall-addrgrp",vdom="kalle-test"} 33188 + fortigate_vdom_resource_object_guaranteed_max_value{object="firewall-policy",vdom="gur-proddmzext"} 201009 + fortigate_vdom_resource_object_guaranteed_max_value{object="firewall-policy",vdom="kalle-test"} 201007 + fortigate_vdom_resource_object_guaranteed_max_value{object="ipsec-phase1",vdom="gur-proddmzext"} 20000 + fortigate_vdom_resource_object_guaranteed_max_value{object="ipsec-phase1",vdom="kalle-test"} 20000 + fortigate_vdom_resource_object_guaranteed_max_value{object="ipsec-phase1-interface",vdom="gur-proddmzext"} 0 + fortigate_vdom_resource_object_guaranteed_max_value{object="ipsec-phase1-interface",vdom="kalle-test"} 0 + fortigate_vdom_resource_object_guaranteed_max_value{object="ipsec-phase2",vdom="gur-proddmzext"} 20000 + fortigate_vdom_resource_object_guaranteed_max_value{object="ipsec-phase2",vdom="kalle-test"} 20000 + fortigate_vdom_resource_object_guaranteed_max_value{object="ipsec-phase2-interface",vdom="gur-proddmzext"} 0 + fortigate_vdom_resource_object_guaranteed_max_value{object="ipsec-phase2-interface",vdom="kalle-test"} 0 + fortigate_vdom_resource_object_guaranteed_max_value{object="log-disk-quota",vdom="gur-proddmzext"} 0 + fortigate_vdom_resource_object_guaranteed_max_value{object="log-disk-quota",vdom="kalle-test"} 0 + fortigate_vdom_resource_object_guaranteed_max_value{object="onetime-schedule",vdom="gur-proddmzext"} 5000 + fortigate_vdom_resource_object_guaranteed_max_value{object="onetime-schedule",vdom="kalle-test"} 5000 + fortigate_vdom_resource_object_guaranteed_max_value{object="proxy",vdom="gur-proddmzext"} 64000 + fortigate_vdom_resource_object_guaranteed_max_value{object="proxy",vdom="kalle-test"} 64000 + fortigate_vdom_resource_object_guaranteed_max_value{object="recurring-schedule",vdom="gur-proddmzext"} 1024 + fortigate_vdom_resource_object_guaranteed_max_value{object="recurring-schedule",vdom="kalle-test"} 1024 + fortigate_vdom_resource_object_guaranteed_max_value{object="service-group",vdom="gur-proddmzext"} 4000 + fortigate_vdom_resource_object_guaranteed_max_value{object="service-group",vdom="kalle-test"} 4000 + fortigate_vdom_resource_object_guaranteed_max_value{object="session",vdom="gur-proddmzext"} 200000 + fortigate_vdom_resource_object_guaranteed_max_value{object="session",vdom="kalle-test"} 2.165e+07 + fortigate_vdom_resource_object_guaranteed_max_value{object="sslvpn",vdom="gur-proddmzext"} 0 + fortigate_vdom_resource_object_guaranteed_max_value{object="sslvpn",vdom="kalle-test"} 0 + fortigate_vdom_resource_object_guaranteed_max_value{object="user",vdom="gur-proddmzext"} 5000 + fortigate_vdom_resource_object_guaranteed_max_value{object="user",vdom="kalle-test"} 5000 + fortigate_vdom_resource_object_guaranteed_max_value{object="user-group",vdom="gur-proddmzext"} 2000 + fortigate_vdom_resource_object_guaranteed_max_value{object="user-group",vdom="kalle-test"} 2000 # HELP fortigate_vdom_resource_object_id Object Resource ID # TYPE fortigate_vdom_resource_object_id gauge fortigate_vdom_resource_object_id{object="custom-service",vdom="gur-proddmzext"} 9