Skip to content

Commit

Permalink
Merge pull request #1480 from njuettner/last-sync-metric
Browse files Browse the repository at this point in the history
Prometheus metric: timestamp of last successful sync with the DNS provider
  • Loading branch information
k8s-ci-robot committed Apr 1, 2020
2 parents 2767488 + a959173 commit d0c776b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## v0.7.1 - 2020-04-01

- Prometheus metric: timestamp of last successful sync with the DNS provider (#1480) @njuettner
- Bump alpine base image to 3.11.5 (#1477) @Annegies
- Docs: Add first maintainers in list (#1472) @Raffo
- Fix DomainFilter type in OVH provider (#1469) @ytsarev
- New provider: OVH (#1439) @Hugome

## v0.7.0 - 2020-03-10

- New source: Add support for Skipper's RouteGroup CRD (#1444) @szuecs
Expand Down
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 d0c776b

Please sign in to comment.