1- // Copyright 2025 The Prometheus Authors
1+ // Copyright The Prometheus Authors
22// Licensed under the Apache License, Version 2.0 (the "License");
33// you may not use this file except in compliance with the License.
44// You may obtain a copy of the License at
@@ -23,13 +23,13 @@ import (
2323)
2424
2525func probeSystemHaPeer (c http.FortiHTTP , meta * TargetMetadata ) ([]prometheus.Metric , bool ) {
26- Info := prometheus .NewDesc (
26+ info := prometheus .NewDesc (
2727 "fortigate_ha_peer_info" ,
2828 "Information about the ha peer." ,
2929 []string {"serial" , "vcluster" , "hostname" , "priority" }, nil ,
3030 )
3131
32- Primary := prometheus .NewDesc (
32+ primary := prometheus .NewDesc (
3333 "fortigate_ha_peer_primary" ,
3434 "True when the peer device is the HA primary." ,
3535 []string {"vcluster" , "hostname" }, nil ,
@@ -56,14 +56,14 @@ func probeSystemHaPeer(c http.FortiHTTP, meta *TargetMetadata) ([]prometheus.Met
5656 m := []prometheus.Metric {}
5757 for _ , r := range res .Result {
5858 if meta .VersionMajor >= 7 && meta .VersionMinor >= 4 {
59- m = append (m , prometheus .MustNewConstMetric (Info , prometheus .GaugeValue , 1 , r .Serial , strconv .FormatInt (r .Vcluster , 10 ), r .Hostname , strconv .FormatFloat (r .Priority , 'f' , - 1 , 64 )))
59+ m = append (m , prometheus .MustNewConstMetric (info , prometheus .GaugeValue , 1 , r .Serial , strconv .FormatInt (r .Vcluster , 10 ), r .Hostname , strconv .FormatFloat (r .Priority , 'f' , - 1 , 64 )))
6060 if r .Primary {
61- m = append (m , prometheus .MustNewConstMetric (Primary , prometheus .GaugeValue , 1 , strconv .FormatInt (r .Vcluster , 10 ), r .Hostname ))
61+ m = append (m , prometheus .MustNewConstMetric (primary , prometheus .GaugeValue , 1 , strconv .FormatInt (r .Vcluster , 10 ), r .Hostname ))
6262 } else {
63- m = append (m , prometheus .MustNewConstMetric (Primary , prometheus .GaugeValue , 0 , strconv .FormatInt (r .Vcluster , 10 ), r .Hostname ))
63+ m = append (m , prometheus .MustNewConstMetric (primary , prometheus .GaugeValue , 0 , strconv .FormatInt (r .Vcluster , 10 ), r .Hostname ))
6464 }
6565 } else {
66- m = append (m , prometheus .MustNewConstMetric (Info , prometheus .GaugeValue , - 1 , "None" , "0" , "None" , "false" ))
66+ m = append (m , prometheus .MustNewConstMetric (info , prometheus .GaugeValue , - 1 , "None" , "0" , "None" , "false" ))
6767 break
6868 }
6969 }
0 commit comments