51 Commits

Author SHA1 Message Date
Ciprian Hacman
2e69489cc6 Update golangci-lint to v2.6.2 2025-11-29 10:42:18 +02:00
Sergey Kanzhelev
0ce333bbc5 enabled and fixed the errcheck linter rule 2025-09-10 21:45:46 +00:00
Sergey Kanzhelev
a3a4504706 fix the static ckeck linter issues 2025-09-08 19:10:28 +00:00
Sergey Kanzhelev
75bf501888 format imports 2025-08-13 16:56:32 +00:00
googs1025
cf0870fa12 chore: refactor custom plugin monitor method 2024-12-27 09:24:47 +08:00
Stanislav
f24dbb13f7 fix bug in skip_initial_status 2024-02-02 14:33:11 +01:00
Manuel Rüger
e43459d86d Move glog/klog logging to klog/v2 2023-09-17 08:57:33 +03:00
guoguangwu
6dc23ca804 chore: remove refs to deprecated io/ioutil 2023-06-21 12:12:27 +08:00
Kubernetes Prow Robot
0dc032e76f Merge pull request #715 from zendesk/grosser/check-result
log failed results at a higher verbosity level
2023-01-31 10:48:49 -08:00
jasonjung
cc6c049522 add comments for cpm 2022-11-12 13:43:02 -08:00
Michael Grosser
169ff4f9fe log failed results at a higher verbosity level 2022-10-19 14:31:18 -07:00
Kubernetes Prow Robot
7bc362cfdc Merge pull request #668 from grosser/grosser/systemd
show failed statuses as warning
2022-07-26 19:16:38 -07:00
Kubernetes Prow Robot
341af62275 Merge pull request #646 from notchairmk/notchairmk/custom-skip-initial
Allow skipping condition during customplugin initialization
2022-07-26 19:16:31 -07:00
diamondburned
6809f445eb Remove unused resultChan field in CPM
This commit removes the resultChan field in ./pkg/custompluginmonitor's
customPluginMonitor struct. This was detected by staticcheck:

    ―❤―▶ staticcheck ./pkg/custompluginmonitor/
    pkg/custompluginmonitor/custom_plugin_monitor.go:50:2: field resultChan is unused (U1000)
2022-07-12 21:43:05 -07:00
Andrew Garrett
a39a7c6e0f Add condition message to event message
If you're using some monitoring solution that aggregates events from
your Kubernetes cluster, having the underlying reason why a condition
triggered could be very useful, especially if you are using custom
plugin monitors.

Co-authored-by: Micah Norman <micnorman@paypal.com>
Signed-off-by: Ryan Eschinger <reschinger@paypal.com>
2022-06-08 21:42:40 +00:00
Michael Grosser
011b9e6a46 show failed statuses as warning 2022-04-26 11:50:10 -07:00
Taylor Chaparro
9344c938bb Allow skipping condition during customplugin initialization 2022-04-26 10:12:01 -07:00
Jeremy Edwards
4181ece888 Windows Support: Fix Build Regressions, Tests Pass 2021-03-14 10:24:45 -07:00
zhangyue
98ba606d4f fix check for timeout
Signed-off-by: zhangyue <huaihuan.zy@alibaba-inc.com>
2021-01-30 21:35:00 +08:00
Kubernetes Prow Robot
45f70a8b26 Merge pull request #456 from ZYecho/fix_timeout
fix: fix script timeout can't work
2021-01-19 19:01:58 -08:00
zhangyue
4f68b251ac fix: fix script timeout can't work
Signed-off-by: zhangyue <huaihuan.zy@alibaba-inc.com>
2021-01-13 20:53:25 +08:00
Kubernetes Prow Robot
1e917af560 Merge pull request #455 from ZYecho/fix_newmessage
fix: print result's message when status unknown
2020-11-24 16:14:39 -08:00
zhangyue
b51cb3219f fix: print result's message when status unknown
Signed-off-by: zhangyue <huaihuan.zy@alibaba-inc.com>
2020-11-18 19:30:17 +08:00
Archit Bansal
8c94d5e60c Add logging levels to custom plugin logs. 2020-08-28 12:51:50 -07:00
Archit Bansal
3a9370e01b Log custom plugin stderr only if the status is not ok.
Otherwise with plugins that run frequently and report ok status, the
logs are filled with unnecessary noise and significantly increases log
size.
2020-08-27 10:17:05 -07:00
Frame
9678892546 Fix typo in custom-plugin-monitor 2020-08-03 17:08:42 +08:00
Kubernetes Prow Robot
f3ab10eddb Merge pull request #442 from abansal4032/custom-plugin-logs-capture
Capture the logs from stderr of custom plugins
2020-07-29 14:18:03 -07:00
Archit Bansal
6acf5b1edb Capture the logs from stderr of custom plugins. 2020-07-29 11:57:05 -07:00
Archit Bansal
f80f3e0dfa Generate status generation logs from custom plugin run only on condition change. 2020-07-24 09:39:39 -07:00
yuzhiquan
9c24be2da4 cleanup: using time.Since(t) instead of t.Sub(time.Now()) 2019-12-05 18:57:53 +08:00
Lantao Liu
be7cc78aa0 Properly close channel when monitor exits.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-10-25 14:11:39 -07:00
Kubernetes Prow Robot
bac3429522 Merge pull request #359 from gmemcc/hotfix-closed-channel
fix close of closed channel
2019-10-24 20:57:38 -07:00
Michael Grosser
3be50a088a untangle plugin runner a bit
add some docs and make it clearer what is actually going on
(parallel rule execution on start and then on timer)
2019-10-10 15:46:04 -07:00
Alex Wong
60e048d2ce fix close of closed channel 2019-09-24 16:07:47 +08:00
Kubernetes Prow Robot
e280e2075a Merge pull request #320 from wangzhen127/custom-plugin-fix
Don't update condition if status stays False/Unknown for custom plugin
2019-08-07 17:09:18 -07:00
Zhen Wang
30e20c6a20 Validate that permanent problem has preset default condition 2019-08-01 23:40:16 -07:00
Zhen Wang
2f5d03280a Don't update condition if status stays False/Unknown for custom plugin 2019-08-01 23:40:16 -07:00
Zhen Wang
182a9450dd Print monitor config path in the logs 2019-07-30 11:00:47 -07:00
Xuewei Zhang
94af7de97b Report metrics from custom-plugin-monitor 2019-07-25 11:28:38 -07:00
Xuewei Zhang
7ad5dec712 Add disk metrics support. 2019-06-13 00:51:17 -07:00
Xuewei Zhang
a07176073a Add existing monitors into the problem daemon registration hook. 2019-06-13 00:51:17 -07:00
Yang Guo
468a23d09a Run custom plugins immediately on startup 2019-06-04 09:42:34 -07:00
Andy Xie
33dffe0761 enable codnition updaet when message change for custom plugin 2018-12-11 13:14:49 +08:00
Zhen Wang
3062622d7c More fix to custom plugin monitor condition change 2018-11-27 10:59:40 -08:00
k8s-ci-robot
d793330dcd Merge pull request #203 from andyxning/fix_custom_plugin_monitor_condition_change
fix custom plugin monitor condition change
2018-11-27 10:37:42 -08:00
Zhen Wang
1f636381b8 Detect kubelet and container runtime frequent crashes 2018-11-26 22:41:06 -08:00
Andy Xie
e3b37719ec fix custom plugin monitor condition change 2018-11-12 17:57:55 +08:00
Lantao Liu
ee103dd4ac Generate event for condition change and support unknown status. 2018-06-21 15:29:53 -07:00
David Ashpole
bf730e9c63 add log-counter go plugin 2018-06-20 15:55:19 -07:00
Kai Chen
bc08bd0b80 Use camelCase instead of snake_case per Golang convention 2018-01-22 23:42:13 +08:00