diff --git a/zfs_replication_exporter.go b/zfs_replication_exporter.go index 4c57075..fcf7bb1 100644 --- a/zfs_replication_exporter.go +++ b/zfs_replication_exporter.go @@ -115,6 +115,9 @@ type filesystemStat struct { // FreenasCounts is the number of snapshots matching freenas' auto-snapshot // names. FreenasCounts int + // LinuxCounts is the number of snapshots matching linux' auto-snapshot + // names. + LinuxCounts int } type snapshotStats map[filesystemName]*filesystemStat @@ -176,7 +179,7 @@ func fetchSnapshotStats(host string, c *ssh.Client) (snapshotStats, error) { continue } glog.V(3).Infof("filesystem: %s timestamp %v", l, t) - stats[name].FreenasCounts++ + stats[name].LinuxCounts++ 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) { @@ -197,6 +200,7 @@ func updateMetrics(host string, stats snapshotStats) { for filesystem, stat := range stats { 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)) snapshotTimestampMetric.WithLabelValues(host, string(filesystem)).Set(float64(stat.Timestamp.Unix())) } } @@ -227,6 +231,7 @@ var indexTmpl = template.Must(template.New("index").Parse(`