Skip to content

WIP feat(source): metric and event for invalid endpoints#6242

Closed
ivankatliarchuk wants to merge 1 commit intokubernetes-sigs:masterfrom
gofogo:metrics-invalid-endpoints
Closed

WIP feat(source): metric and event for invalid endpoints#6242
ivankatliarchuk wants to merge 1 commit intokubernetes-sigs:masterfrom
gofogo:metrics-invalid-endpoints

Conversation

@ivankatliarchuk
Copy link
Copy Markdown
Member

WHY

Invalid endpoints — misconfigured CNAME self-references, malformed MX/SRV records, unsupported alias types — are silently dropped by the dedup source with only a log
warning. In production clusters this creates a blind spot: there is no way to alert on broken DNS configurations, measure how many exist, or trace which Kubernetes
resource is responsible. Operators discover the problem only by grepping logs or noticing that a DNS record never appears.


WHAT

  • Adds external_dns_source_invalid_endpoints{record_type, source_type} gauge — resets and refills each reconcile cycle, so it directly answers "how many broken endpoints
    exist right now" per record type and source. source_type is populated from RefObject.Source when available, falls back to "unknown" until source implementations provide
    RefObject.
  • Emits a Kubernetes Event (action=FailedSync, reason=RecordError) per rejected endpoint, gated by the existing --emit-events=RecordError flag, so no extra configuration
    is needed.
  • Extracts buildEventEmitter from buildController in execute.go so the emitter is constructed before the source pipeline and shared with the dedup layer — no duplication.

More

  • Yes, this PR title follows Conventional Commits
  • Yes, I added unit tests
  • Yes, I updated end user documentation accordingly

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 1, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign szuecs for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the controller Issues or PRs related to the controller label Mar 1, 2026
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. source labels Mar 1, 2026
@ivankatliarchuk ivankatliarchuk deleted the metrics-invalid-endpoints branch March 1, 2026 23:52
@ivankatliarchuk ivankatliarchuk restored the metrics-invalid-endpoints branch March 1, 2026 23:52
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. controller Issues or PRs related to the controller do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants