Skip to content

Commit

Permalink
[fix] corrected metric name
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Norberg committed Oct 14, 2024
1 parent 3ce249d commit 7de3bc1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pkg/probe/system_ha_peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
func probeSystemHAPeer(c http.FortiHTTP, meta *TargetMetadata) ([]prometheus.Metric, bool) {
var (
memberInfo = prometheus.NewDesc(
"fortigate_ha_member_info",
"fortigate_ha_peer_info",
"Info metrics regarding cluster HA peers",
[]string{"vdom", "hostname", "serial", "priority", "vcluster_id", "primary"}, nil,
)
Expand Down
16 changes: 8 additions & 8 deletions pkg/probe/system_ha_peer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ func TestHAPeer(t *testing.T) {
}

em := `
# HELP fortigate_ha_member_info Info metrics regarding cluster HA peers
# TYPE fortigate_ha_member_info gauge
fortigate_ha_member_info{hostname="member-name-1",primary="Unsupported",priority="200",serial="FGT61E4QXXXXXXXX1",vcluster_id="0",vdom="root"} 1
fortigate_ha_member_info{hostname="member-name-2",primary="Unsupported",priority="100",serial="FGT61E4QXXXXXXXX2",vcluster_id="0",vdom="root"} 1
# HELP fortigate_ha_peer_info Info metrics regarding cluster HA peers
# TYPE fortigate_ha_peer_info gauge
fortigate_ha_peer_info{hostname="member-name-1",primary="Unsupported",priority="200",serial="FGT61E4QXXXXXXXX1",vcluster_id="0",vdom="root"} 1
fortigate_ha_peer_info{hostname="member-name-2",primary="Unsupported",priority="100",serial="FGT61E4QXXXXXXXX2",vcluster_id="0",vdom="root"} 1
`

if err := testutil.GatherAndCompare(r, strings.NewReader(em)); err != nil {
Expand All @@ -45,10 +45,10 @@ func TestHAPeer74(t *testing.T) {
}

em := `
# HELP fortigate_ha_member_info Info metrics regarding cluster HA peers
# TYPE fortigate_ha_member_info gauge
fortigate_ha_member_info{hostname="member-name-1",primary="true",priority="200",serial="FGT61E4QXXXXXXXX1",vcluster_id="0",vdom="root"} 1
fortigate_ha_member_info{hostname="member-name-2",primary="false",priority="100",serial="FGT61E4QXXXXXXXX2",vcluster_id="0",vdom="root"} 1
# HELP fortigate_ha_peer_info Info metrics regarding cluster HA peers
# TYPE fortigate_ha_peer_info gauge
fortigate_ha_peer_info{hostname="member-name-1",primary="true",priority="200",serial="FGT61E4QXXXXXXXX1",vcluster_id="0",vdom="root"} 1
fortigate_ha_peer_info{hostname="member-name-2",primary="false",priority="100",serial="FGT61E4QXXXXXXXX2",vcluster_id="0",vdom="root"} 1
`

if err := testutil.GatherAndCompare(r, strings.NewReader(em)); err != nil {
Expand Down

0 comments on commit 7de3bc1

Please sign in to comment.