mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2025-08-06 09:36:58 +02:00
Merge pull request #3340 from gozer/issue/3339/last_reconcile_timestamp_seconds
Add external_dns_controller_last_reconcile_timestamp_seconds metric
This commit is contained in:
commit
bc22050579
@ -73,6 +73,14 @@ var (
|
||||
Help: "Timestamp of last successful sync with the DNS provider",
|
||||
},
|
||||
)
|
||||
lastReconcileTimestamp = prometheus.NewGauge(
|
||||
prometheus.GaugeOpts{
|
||||
Namespace: "external_dns",
|
||||
Subsystem: "controller",
|
||||
Name: "last_reconcile_timestamp_seconds",
|
||||
Help: "Timestamp of last attempted sync with the DNS provider",
|
||||
},
|
||||
)
|
||||
controllerNoChangesTotal = prometheus.NewCounter(
|
||||
prometheus.CounterOpts{
|
||||
Namespace: "external_dns",
|
||||
@ -151,6 +159,7 @@ func init() {
|
||||
prometheus.MustRegister(sourceEndpointsTotal)
|
||||
prometheus.MustRegister(registryEndpointsTotal)
|
||||
prometheus.MustRegister(lastSyncTimestamp)
|
||||
prometheus.MustRegister(lastReconcileTimestamp)
|
||||
prometheus.MustRegister(deprecatedRegistryErrors)
|
||||
prometheus.MustRegister(deprecatedSourceErrors)
|
||||
prometheus.MustRegister(controllerNoChangesTotal)
|
||||
@ -191,6 +200,8 @@ type Controller struct {
|
||||
|
||||
// RunOnce runs a single iteration of a reconciliation loop.
|
||||
func (c *Controller) RunOnce(ctx context.Context) error {
|
||||
lastReconcileTimestamp.SetToCurrentTime()
|
||||
|
||||
records, err := c.Registry.Records(ctx)
|
||||
if err != nil {
|
||||
registryErrorsTotal.Inc()
|
||||
@ -248,6 +259,7 @@ func (c *Controller) RunOnce(ctx context.Context) error {
|
||||
}
|
||||
|
||||
lastSyncTimestamp.SetToCurrentTime()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -179,8 +179,9 @@ You can use the host label in the metric to figure out if the request was agains
|
||||
Here is the full list of available metrics provided by ExternalDNS:
|
||||
|
||||
| Name | Description | Type |
|
||||
| --------------------------------------------------- | ------------------------------------------------------------------ | ------- |
|
||||
| -------------------------------------------------------- | ------------------------------------------------------------------ | ------- |
|
||||
| external_dns_controller_last_sync_timestamp_seconds | Timestamp of last successful sync with the DNS provider | Gauge |
|
||||
| external_dns_controller_last_reconcile_timestamp_seconds | Timestamp of last attempted sync with the DNS provider | Gauge |
|
||||
| external_dns_registry_endpoints_total | Number of Endpoints in all sources | Gauge |
|
||||
| external_dns_registry_errors_total | Number of Registry errors | Counter |
|
||||
| external_dns_source_endpoints_total | Number of Endpoints in the registry | Gauge |
|
||||
@ -192,6 +193,7 @@ Here is the full list of available metrics provided by ExternalDNS:
|
||||
| external_dns_source_aaaa_records | Number of AAAA records in source | Gauge |
|
||||
| external_dns_source_a_records | Number of A records in source | Gauge |
|
||||
|
||||
|
||||
### How can I run ExternalDNS under a specific GCP Service Account, e.g. to access DNS records in other projects?
|
||||
|
||||
Have a look at https://github.com/linki/mate/blob/v0.6.2/examples/google/README.md#permissions
|
||||
|
Loading…
Reference in New Issue
Block a user