Skip to content

Commit

Permalink
Timestamp of last successful sync with the DNS provider
Browse files Browse the repository at this point in the history
  • Loading branch information
njuettner committed Apr 1, 2020
1 parent 2767488 commit f13c146
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ var (
Help: "Number of Endpoints in the registry",
},
)
lastSyncTimestamp = prometheus.NewGauge(
prometheus.GaugeOpts{
Namespace: "external_dns",
Subsystem: "controller",
Name: "last_sync_timestamp_seconds",
Help: "Timestamp of last successful sync with the DNS provider",
},
)
deprecatedRegistryErrors = prometheus.NewCounter(
prometheus.CounterOpts{
Subsystem: "registry",
Expand All @@ -84,6 +92,7 @@ func init() {
prometheus.MustRegister(sourceErrorsTotal)
prometheus.MustRegister(sourceEndpointsTotal)
prometheus.MustRegister(registryEndpointsTotal)
prometheus.MustRegister(lastSyncTimestamp)
prometheus.MustRegister(deprecatedRegistryErrors)
prometheus.MustRegister(deprecatedSourceErrors)
}
Expand Down Expand Up @@ -140,6 +149,8 @@ func (c *Controller) RunOnce(ctx context.Context) error {
deprecatedRegistryErrors.Inc()
return err
}

lastSyncTimestamp.SetToCurrentTime()
return nil
}

Expand Down

0 comments on commit f13c146

Please sign in to comment.