Skip to content

Commit a863650

Browse files
33Fraise33Gianni Stubbe
andauthored
doc(probe): improve metric descriptions (#239)
* docs: Updated descriptions of metrics to be self-explanatory * test(interface): Fixed tests for system and ipsec interfaces --------- Co-authored-by: Gianni Stubbe <gianni.stubbe@citymesh.com>
1 parent 8a6f0b3 commit a863650

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

pkg/probe/system_interface.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ func probeSystemInterface(c http.FortiHTTP, meta *TargetMetadata) ([]prometheus.
1111
var (
1212
mLink = prometheus.NewDesc(
1313
"fortigate_interface_link_up",
14-
"Whether the link is up or not",
14+
"Whether the link is up or not (not taking into account admin status)",
1515
[]string{"vdom", "name", "alias", "parent"}, nil,
1616
)
1717
mSpeed = prometheus.NewDesc(

pkg/probe/system_interface_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func TestSystemInterfaces(t *testing.T) {
1717
}
1818

1919
em := `
20-
# HELP fortigate_interface_link_up Whether the link is up or not
20+
# HELP fortigate_interface_link_up Whether the link is up or not (not taking into account admin status)
2121
# TYPE fortigate_interface_link_up gauge
2222
fortigate_interface_link_up{alias="",name="b",parent="",vdom="root"} 0
2323
fortigate_interface_link_up{alias="",name="internal1",parent="",vdom="infra"} 1

pkg/probe/vpn_ipsec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ func probeVPNIPSec(c http.FortiHTTP, meta *TargetMetadata) ([]prometheus.Metric,
1212
var (
1313
status = prometheus.NewDesc(
1414
"fortigate_ipsec_tunnel_up",
15-
"Status of IPsec tunnel",
15+
"Status of IPsec tunnel (0 - Down, 1 - Up)",
1616
[]string{"vdom", "name", "p2serial", "parent"}, nil,
1717
)
1818
transmitted = prometheus.NewDesc(

pkg/probe/vpn_ipsec_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func TestVPNIPSec(t *testing.T) {
2525
# TYPE fortigate_ipsec_tunnel_transmit_bytes_total counter
2626
fortigate_ipsec_tunnel_transmit_bytes_total{name="tunnel_1-sub",p2serial="1",parent="tunnel_1",vdom="root"} 1.424856e+07
2727
fortigate_ipsec_tunnel_transmit_bytes_total{name="tunnel_1-sub",p2serial="12",parent="tunnel_1",vdom="root"} 1.424856e+07
28-
# HELP fortigate_ipsec_tunnel_up Status of IPsec tunnel
28+
# HELP fortigate_ipsec_tunnel_up Status of IPsec tunnel (0 - Down, 1 - Up)
2929
# TYPE fortigate_ipsec_tunnel_up gauge
3030
fortigate_ipsec_tunnel_up{name="tunnel_1-sub",p2serial="1",parent="tunnel_1",vdom="root"} 1
3131
fortigate_ipsec_tunnel_up{name="tunnel_1-sub",p2serial="12",parent="tunnel_1",vdom="root"} 0
@@ -62,7 +62,7 @@ func TestVPNIPSecWithCommonP2Names(t *testing.T) {
6262
fortigate_ipsec_tunnel_transmit_bytes_total{name="CommonP2",p2serial="25",parent="My VPN",vdom="root"} 3.1269542e+07
6363
fortigate_ipsec_tunnel_transmit_bytes_total{name="mgmt",p2serial="1",parent="My VPN",vdom="root"} 0
6464
fortigate_ipsec_tunnel_transmit_bytes_total{name="some-network",p2serial="14",parent="My VPN",vdom="root"} 112307
65-
# HELP fortigate_ipsec_tunnel_up Status of IPsec tunnel
65+
# HELP fortigate_ipsec_tunnel_up Status of IPsec tunnel (0 - Down, 1 - Up)
6666
# TYPE fortigate_ipsec_tunnel_up gauge
6767
fortigate_ipsec_tunnel_up{name="CommonP2",p2serial="22",parent="My VPN",vdom="root"} 0
6868
fortigate_ipsec_tunnel_up{name="CommonP2",p2serial="23",parent="My VPN",vdom="root"} 1

0 commit comments

Comments
 (0)