Skip to content

Commit

Permalink
controller: delete timeseries after cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
talal committed Aug 26, 2020
1 parent 0d59235 commit 8c6aa21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/controller/cleanup.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func (c *Controller) cleanUpOrphanedAbsentAlertsCluster() error {
if err := c.cleanUpOrphanedAbsentAlerts(n, aPR); err != nil {
return err
}
c.metrics.SuccessfulPrometheusRuleReconcileTime.DeleteLabelValues(namespace, n)
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions internal/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,9 @@ func (c *Controller) syncHandler(key string) error {
// orphaned absent alerts.
c.logger.Debug("msg", "PrometheusRule no longer exists", "key", key)
err = c.cleanUpOrphanedAbsentAlertsNamespace(name, namespace)
if err == nil {
c.metrics.SuccessfulPrometheusRuleReconcileTime.DeleteLabelValues(namespace, name)
}
default:
// Requeue object for later processing.
return err
Expand Down

0 comments on commit 8c6aa21

Please sign in to comment.