diff --git a/zfs_replication_exporter.go b/zfs_replication_exporter.go index 312d8d3..67aec4c 100644 --- a/zfs_replication_exporter.go +++ b/zfs_replication_exporter.go @@ -122,6 +122,9 @@ type filesystemStat struct { // LinuxCounts is the number of snapshots matching linux' auto-snapshot // names. LinuxCounts int + // AutosnapshotCounts is the number of snapshots matching zfs-autosnapshot's + // auto-snapshot names. + AutosnapshotCounts int } type snapshotStats map[filesystemName]*filesystemStat @@ -198,7 +201,7 @@ func fetchSnapshotStats(host string, c *ssh.Client) (snapshotStats, error) { continue } glog.V(3).Infof("filesystem: %s timestamp %v", l, t) - stats[name].LinuxCounts++ + stats[name].AutosnapshotCounts++ snapshotTime := stats[name].Timestamp glog.V(3).Infof("snapshotTime.Before(t) = %v snapshotTime: %v t: %v", snapshotTime.Before(t), snapshotTime, t) if snapshotTime.Before(t) { @@ -220,6 +223,7 @@ func updateMetrics(host string, stats snapshotStats) { snapshotCountsMetrics.WithLabelValues(host, string(filesystem), "all").Set(float64(stat.Counts)) snapshotCountsMetrics.WithLabelValues(host, string(filesystem), "freenas").Set(float64(stat.FreenasCounts)) snapshotCountsMetrics.WithLabelValues(host, string(filesystem), "linux").Set(float64(stat.LinuxCounts)) + snapshotCountsMetrics.WithLabelValues(host, string(filesystem), "autosnapshot").Set(float64(stat.AutosnapshotCounts)) snapshotTimestampMetric.WithLabelValues(host, string(filesystem)).Set(float64(stat.Timestamp.Unix())) } } @@ -251,6 +255,7 @@ var indexTmpl = template.Must(template.New("index").Parse(`