Skip to content

Commit

Permalink
Define metrics for total object count and size
Browse files Browse the repository at this point in the history
  • Loading branch information
arunvelsriram committed Aug 12, 2020
1 parent a5c6c9a commit 5229d77
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkg/collector/sftp_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ var (
[]string{"path"},
nil,
)

objectCount = prometheus.NewDesc(
prometheus.BuildFQName(c.Namespace, "", "objects_count_total"),
"Total number of objects in the path",
[]string{"path"},
nil,
)

objectSize = prometheus.NewDesc(
prometheus.BuildFQName(c.Namespace, "", "objects_size_total"),
"Total size of all objects in the path",
[]string{"path"},
nil,
)
)

type SFTPCollector struct {
Expand All @@ -40,6 +54,8 @@ func (s SFTPCollector) Describe(ch chan<- *prometheus.Desc) {
ch <- up
ch <- fsTotalSpace
ch <- fsFreeSpace
ch <- objectCount
ch <- objectSize
}

func (s SFTPCollector) Collect(ch chan<- prometheus.Metric) {
Expand Down

0 comments on commit 5229d77

Please sign in to comment.