-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmetrics.go
More file actions
39 lines (36 loc) · 1.23 KB
/
metrics.go
File metadata and controls
39 lines (36 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
func createIpedMetrics() ipedMetrics {
return ipedMetrics{
calls: promauto.NewCounterVec(prometheus.CounterOpts{
Name: "ipedworker_runIped_calls",
Help: "Number of calls to runIped",
}, []string{"hostname", "evidence"}),
finish: promauto.NewCounterVec(prometheus.CounterOpts{
Name: "ipedworker_runIped_finish",
Help: "Number of finished runs",
}, []string{"hostname", "evidence", "result"}),
running: promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "ipedworker_runIped_running",
Help: "Whether IPED is running or not",
}, []string{"hostname", "evidence"}),
found: promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "ipedworker_runIped_found",
Help: "Number of items found",
}, []string{"hostname", "evidence"}),
processed: promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "ipedworker_runIped_processed",
Help: "Number of items processed",
}, []string{"hostname", "evidence"}),
}
}
type ipedMetrics struct {
calls *prometheus.CounterVec
finish *prometheus.CounterVec
running *prometheus.GaugeVec
found *prometheus.GaugeVec
processed *prometheus.GaugeVec
}