Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

add metrics for DNS events #707

Merged
merged 1 commit into from
Jul 25, 2024
Merged

add metrics for DNS events #707

merged 1 commit into from
Jul 25, 2024

Conversation

philbrookes
Copy link
Contributor

@philbrookes philbrookes commented Jun 17, 2024

Emit metrics for:

  • DNS Policy ready state

ping @mikenairn @eguzki

closes #453

@philbrookes philbrookes requested a review from a team as a code owner June 17, 2024 14:49
@philbrookes philbrookes force-pushed the gh-453 branch 4 times, most recently from bc8cbfd to 4151f2e Compare June 19, 2024 08:34
@philbrookes
Copy link
Contributor Author

ping @mikenairn @eguzki @maleck13 could I get a review here, when you have a chance?

@philbrookes philbrookes force-pushed the gh-453 branch 2 times, most recently from 1c04299 to f366404 Compare July 8, 2024 08:44
}

func (b *BaseReconciler) DeleteResource(ctx context.Context, obj client.Object, options ...client.DeleteOption) error {
logger, _ := logr.FromContext(ctx)
logger.Info("delete object", "kind", strings.Replace(fmt.Sprintf("%T", obj), "*", "", 1), "name", obj.GetName(), "namespace", obj.GetNamespace())
return b.Client().Delete(ctx, obj, options...)
if obj.GetDeletionTimestamp() != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a check here, to not reissue delete requests on items already deleting.

@mikenairn
Copy link
Member

Since it was deemed that this was necessary for DNSPolicy, would the same not be true for all policies? Presumably this is intended to be used along some alert or dashboard that signals if CRUD operations are happening too frequently?

@philbrookes
Copy link
Contributor Author

Since it was deemed that this was necessary for DNSPolicy, would the same not be true for all policies? Presumably this is intended to be used along some alert or dashboard that signals if CRUD operations are happening too frequently?

I think this was deemed necessary for DNS Policy as it could result in excessive traffic to the DNS Provider API, which is not a problem with the other policies?

Copy link
Collaborator

@maleck13 maleck13 left a comment

Choose a reason for hiding this comment

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

THis looks a much simpler solution
/lgtm

@maleck13 maleck13 merged commit 6553bb1 into Kuadrant:main Jul 25, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dnspolicy: Emit a metric for Policy ready status
4 participants