Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix clearing instance metrics when namespace is deleted #1024

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions controllers/tempo/tempomonolithic_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ func (r *TempoMonolithicReconciler) Reconcile(ctx context.Context, req ctrl.Requ
log.Error(err, "unable to fetch TempoMonolithic")
return ctrl.Result{}, fmt.Errorf("could not fetch tempo: %w", err)
}
// instance is not found, metrics can be cleared
status.ClearMonolithicMetrics(req.Namespace, req.Name)

// we'll ignore not-found errors, since they can't be fixed by an immediate
// requeue (we'll need to wait for a new notification), and we can get them
Expand Down
2 changes: 2 additions & 0 deletions controllers/tempo/tempostack_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ func (r *TempoStackReconciler) Reconcile(ctx context.Context, req ctrl.Request)
log.Error(err, "unable to fetch TempoStack")
return ctrl.Result{}, fmt.Errorf("could not fetch tempo: %w", err)
}
// instance is not found, metrics can be cleared
status.ClearTempoStackMetrics(req.Namespace, req.Name)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we always get a reconcile event on deletion? could we remove the ClearTempoStackMetrics() from the deletion webhook then?


// we'll ignore not-found errors, since they can't be fixed by an immediate
// requeue (we'll need to wait for a new notification), and we can get them
Expand Down
Loading