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

GH-34 emmit write counter as a metric #74

Merged
merged 1 commit into from
Apr 16, 2024
Merged

GH-34 emmit write counter as a metric #74

merged 1 commit into from
Apr 16, 2024

Conversation

maksymvavilov
Copy link
Contributor

Emmiting write counter as a metric and setting an upper limit for the counter after witch we give up

@maksymvavilov maksymvavilov linked an issue Apr 12, 2024 that may be closed by this pull request
@maksymvavilov maksymvavilov force-pushed the GH-34 branch 2 times, most recently from 70a865b to 25f09fb Compare April 12, 2024 10:04
@maksymvavilov maksymvavilov marked this pull request as ready for review April 15, 2024 09:57
@@ -336,8 +339,16 @@ func (r *DNSRecordReconciler) applyChanges(ctx context.Context, dnsRecord *v1alp
// generation has not changed but there are changes.
// implies that they were overridden - bump write counter
if !generationChanged(dnsRecord) {
dnsRecord.Status.WriteCounter++
logger.V(3).Info("Changes needed on the same generation of record")
if dnsRecord.Status.WriteCounter < WriteCounterLimit {
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 set any dimension on this metric? Seems like we should set the the dnsRecord name and namespace as labels?

Copy link
Collaborator

Choose a reason for hiding this comment

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

As I read it we will increment this for all dns records so only ever 20 writes or am I mistaken

Copy link
Contributor Author

@maksymvavilov maksymvavilov Apr 16, 2024

Choose a reason for hiding this comment

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

yes, only 20 writes per generation of DNS record (frankly, if we have more than 2 writes per gen something is wrong with the DNS provider or, more accurately, something keeps overriding changes)

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.

I think the metric is not unique per dnsrecord?

@maksymvavilov
Copy link
Contributor Author

maksymvavilov commented Apr 16, 2024

image
This is how it will behave now. That should be much better (screenshot from e2e tests running locally). Is this what you meant @maleck13 ?
[the first pancake of baking metrics was burned 😆 ]

@maleck13 maleck13 added this pull request to the merge queue Apr 16, 2024
Merged via the queue into main with commit e588a6e Apr 16, 2024
9 checks passed
@maksymvavilov maksymvavilov deleted the GH-34 branch May 23, 2024 10:13
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.

Record write attempts in status for current generation
2 participants