Skip to content

Commit

Permalink
add prom gauge for total records.
Browse files Browse the repository at this point in the history
  • Loading branch information
gerrowadat committed Apr 12, 2024
1 parent f220b67 commit 952fdf0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ var (
Name: "dns_changes_processed_total",
Help: "The total number of DNS changes processed",
})
dnsTotalRecordCount = promauto.NewGauge(prometheus.GaugeOpts{
Name: "dns_total_record_count",
Help: "The total number of DNS records",
})
)

type CloudDNSSpec struct {
Expand Down
1 change: 1 addition & 0 deletions nomad.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func syncNomad(dnsSpec *CloudDNSSpec, nomadSpec *NomadSpec, pruneMissing *bool)
if err != nil {
log.Fatal("Updating Cloud DNS from nomad:", err)
}
dnsTotalRecordCount.Set(float64(len(jobLocs)))
}

func getNomadNodesList(nomadSpec *NomadSpec) NodeInfo {
Expand Down

0 comments on commit 952fdf0

Please sign in to comment.