Skip to content

Commit aef7cd0

Browse files
committed
Renamed metrics
Signed-off-by: Örnfeldt Philip (66140321) <[email protected]>
1 parent 691b446 commit aef7cd0

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

pkg/probe/system_sandbox_stats.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,32 @@ import (
2323
func probeSystemSandboxStats (c http.FortiHTTP, meta *TargetMetadata) ([]prometheus.Metric, bool) {
2424
var (
2525
numberDetected = prometheus.NewDesc(
26-
"fortigate_sandbox_stats_detected",
26+
"fortigate_sandbox_stats_detected_total",
2727
"Number of detected files",
2828
[]string{}, nil,
2929
)
3030
numberClean = prometheus.NewDesc(
31-
"fortigate_sandbox_stats_clean",
31+
"fortigate_sandbox_stats_clean_total",
3232
"Number of clean files",
3333
[]string{}, nil,
3434
)
3535
numberRiskLow = prometheus.NewDesc(
36-
"fortigate_sandbox_stats_risk_low",
36+
"fortigate_sandbox_stats_risk_low_total",
3737
"Number of low risk files detected",
3838
[]string{}, nil,
3939
)
4040
numberRiskMedium = prometheus.NewDesc(
41-
"fortigate_sandbox_stats_risk_medium",
41+
"fortigate_sandbox_stats_risk_medium_total",
4242
"Number of medium risk files detected",
4343
[]string{}, nil,
4444
)
4545
numberRiskHigh = prometheus.NewDesc(
46-
"fortigate_sandbox_stats_risk_high",
46+
"fortigate_sandbox_stats_risk_high_total",
4747
"Number of high risk files detected",
4848
[]string{}, nil,
4949
)
5050
numberSubmitted = prometheus.NewDesc(
51-
"fortigate_sandbox_stats_submitted",
51+
"fortigate_sandbox_stats_submitted_total",
5252
"Number of submitted files",
5353
[]string{}, nil,
5454
)

pkg/probe/system_sandbox_stats_test.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,24 @@ func TestSystemSandboxStats(t *testing.T) {
3030
}
3131

3232
em := `
33-
# HELP fortigate_sandbox_stats_clean Number of clean files
34-
# TYPE fortigate_sandbox_stats_clean counter
35-
fortigate_sandbox_stats_clean 45120
36-
# HELP fortigate_sandbox_stats_detected Number of detected files
37-
# TYPE fortigate_sandbox_stats_detected counter
38-
fortigate_sandbox_stats_detected 10
39-
# HELP fortigate_sandbox_stats_risk_high Number of high risk files detected
40-
# TYPE fortigate_sandbox_stats_risk_high counter
41-
fortigate_sandbox_stats_risk_high 5
42-
# HELP fortigate_sandbox_stats_risk_low Number of low risk files detected
43-
# TYPE fortigate_sandbox_stats_risk_low counter
44-
fortigate_sandbox_stats_risk_low 3
45-
# HELP fortigate_sandbox_stats_risk_medium Number of medium risk files detected
46-
# TYPE fortigate_sandbox_stats_risk_medium counter
47-
fortigate_sandbox_stats_risk_medium 2
48-
# HELP fortigate_sandbox_stats_submitted Number of submitted files
49-
# TYPE fortigate_sandbox_stats_submitted counter
50-
fortigate_sandbox_stats_submitted 45130
33+
# HELP fortigate_sandbox_stats_clean_total Number of clean files
34+
# TYPE fortigate_sandbox_stats_clean_total counter
35+
fortigate_sandbox_stats_clean_total 45120
36+
# HELP fortigate_sandbox_stats_detected_total Number of detected files
37+
# TYPE fortigate_sandbox_stats_detected_total counter
38+
fortigate_sandbox_stats_detected_total 10
39+
# HELP fortigate_sandbox_stats_risk_high_total Number of high risk files detected
40+
# TYPE fortigate_sandbox_stats_risk_high_total counter
41+
fortigate_sandbox_stats_risk_high_total 5
42+
# HELP fortigate_sandbox_stats_risk_low_total Number of low risk files detected
43+
# TYPE fortigate_sandbox_stats_risk_low_total counter
44+
fortigate_sandbox_stats_risk_low_total 3
45+
# HELP fortigate_sandbox_stats_risk_medium_total Number of medium risk files detected
46+
# TYPE fortigate_sandbox_stats_risk_medium_total counter
47+
fortigate_sandbox_stats_risk_medium_total 2
48+
# HELP fortigate_sandbox_stats_submitted_total Number of submitted files
49+
# TYPE fortigate_sandbox_stats_submitted_total counter
50+
fortigate_sandbox_stats_submitted_total 45130
5151
`
5252

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

pkg/probe/system_sandbox_status.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ func probeSystemSandboxStatus (c http.FortiHTTP, meta *TargetMetadata) ([]promet
5151
return nil, false
5252
}
5353
m := []prometheus.Metric{}
54-
cloude := "null"
54+
cloud := "null"
5555
if res.Result.Cloud != "" {
56-
cloude = res.Result.Cloud
56+
cloud = res.Result.Cloud
5757
}
5858
m = append(m, prometheus.MustNewConstMetric(
5959
Count,
6060
prometheus.GaugeValue,
6161
res.Result.Count,
6262
strconv.FormatBool(res.Result.Configured),
6363
res.Result.Type,
64-
cloude,
64+
cloud,
6565
res.Result.Server,
6666
res.Result.MPV,
6767
strconv.FormatBool(res.Result.Loaded),

0 commit comments

Comments
 (0)