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

feat: add watch error handler for Kubernetes client #447

Merged
merged 1 commit into from
Dec 13, 2022

Conversation

diafour
Copy link
Contributor

@diafour diafour commented Dec 13, 2022

Overview

Add WatchErrorHandler implementation to log informer errors and increase new metric counter.

What this PR does / why we need it

shell-operator will log messages about problems with connection to the apiserver:

{"hook":"pods-v1.sh","level":"error","msg":"kubernetes[0]{crontabs}: Failed to watch ct: failed to list *unstructured.Unstructured: Get \"https://10.96.0.1:443/apis/stable.example.com/v1/crontabs?resourceVersion=369642\": dial tcp 10.96.0.1:443: connect: connection refused","time":"2022-12-13T11:59:21Z"}
# HELP shell_operator_kubernetes_client_watch_errors_total shell_operator_kubernetes_client_watch_errors_total
# TYPE shell_operator_kubernetes_client_watch_errors_total counter
shell_operator_kubernetes_client_watch_errors_total{error_type="fail"} 15

Special notes for your reviewer

Does this PR introduce a user-facing change?


Add WatchErrorHandler implementation to log informer errors and increase new metric counter.

Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
@diafour diafour requested a review from yalosev December 13, 2022 12:29
@diafour diafour self-assigned this Dec 13, 2022
@diafour diafour merged commit 35d6404 into main Dec 13, 2022
@yalosev yalosev deleted the feat_watch_error_handler branch January 18, 2023 22:03
@diafour diafour added this to the 1.1.2 milestone Feb 8, 2023
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.

None yet

2 participants