Commit Graph
310 Commits
Author SHA1 Message Date
Veer Singh be4034f35a Cache compiled regular expressions in the log buffer
This change keeps each compiled regular expression in a cache in the
log buffer. The cache size is not more than the number of patterns
given to Match.

This change removes the TODO in log_buffer.go.
2026-07-20 16:12:36 -07:00
Ciprian Hacman a20306e6a1 fix(logwatchers/kmsg): don't close the old parser twice when Stop() interrupts a restart
The restart path closes the failed parser before retrying. If stopping
is signaled during the retry wait, watchLoop's deferred cleanup closed
the same parser again, logging a spurious 'file already closed' error
at shutdown. Clear the reference after closing and nil-check the defer.
2026-07-11 10:28:27 +03:00
Ciprian Hacman b77c1eb03f fix(logwatchers/kmsg): don't block Stop() when the log channel is full
The log monitor stops draining logCh before calling watcher.Stop(), so
with a full channel (e.g. a kmsg burst at shutdown) watchLoop blocked
on the send forever, never called tomb.Done(), and Stop() hung.
Select on tomb.Stopping() alongside the send.
2026-07-11 10:27:59 +03:00
Ciprian Hacman 187d4d30d6 fix(logwatchers/kmsg): rate-limit parser restarts to prevent hot loop
If the restarted parser's channel closes again right away (reads keep
failing on the reopened /dev/kmsg), the watcher restarts in a tight
loop with no delay, spinning a CPU core and flooding the logs
(measured 37k restarts in 200ms). Delay the first attempt when the
previous restart was less than retryDelay ago.
2026-07-11 10:27:37 +03:00
Ciprian Hacman 3d516d9213 test(logwatchers/kmsg): inject parser factory for testability and cover restart/stop 2026-04-11 08:37:32 +03:00
Kubernetes Prow RobotandGitHub ea22add87e Merge pull request #1259 from hakman/kmsg-duplicate-message
fix(logwatchers/kmsg): prevent duplicate message replay after restart
2026-04-11 00:18:18 +05:30
Ciprian Hacman b3379b0d23 fix(logwatchers/kmsg): prevent duplicate message replay after restart 2026-04-10 16:06:32 +03:00
Ciprian Hacman 78f76b2778 fix(logwatchers/kmsg): don't close parser from Stop()
Closing the parser in Stop() triggers kmsgparser's read goroutine to
close its output channel, which made watchLoop take the restart path
(added in #1192) during intentional shutdown. Leave parser cleanup to
watchLoop's defer, which is the single owner of the parser lifecycle.
2026-04-10 15:45:22 +03:00
Arjun Raman 748fecd95d Remove opt-in knob for restarting kmsg parser and simplify retry loop 2026-03-24 11:20:14 -07:00
Arjun RamanandGitHub c530d1f701 Remove log message for restart on error
Removed log message for disabled restart on error.
2025-12-18 12:29:26 -08:00
Arjun Raman f1bdf8d30e Restart kmsg on error 2025-12-11 15:51:24 -08:00
Kubernetes Prow RobotandGitHub c0cfee4920 Merge pull request #1177 from hakman/depup
CodeQL / Analyze (go) (push) Failing after 1m28s
Scorecard supply-chain security / Scorecard analysis (push) Failing after 54s
Update dependencies and bump Go to v1.24.10
2025-12-02 03:46:24 -08:00
Ciprian Hacman 6b19393e1c Update dependencies and bump Go to v1.24.10 2025-11-29 11:15:51 +02:00
Ciprian Hacman 2e69489cc6 Update golangci-lint to v2.6.2 2025-11-29 10:42:18 +02:00
novahe 8844692098 Remove the invalid node.UID 2025-10-23 23:10:34 +08:00
Sergey Kanzhelev ad9436c5c9 fix linter issues 2025-10-22 22:36:03 +00:00
marinoborgesandGitHub 6d71278653 Fix newFakeProblemClient call 2025-10-13 16:36:03 -03:00
marinoborgesandGitHub 0de0e3bc53 Set APIVersion:v1 for node events 2025-10-09 00:42:49 -03:00
Sergey Kanzhelev 3e64800668 enabled a few more linter rules 2025-09-11 18:47:20 +00: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 db7eb8366c updated gopsutil 2025-08-13 21:53:17 +00:00
Sergey Kanzhelev 75bf501888 format imports 2025-08-13 16:56:32 +00:00
Kubernetes Prow RobotandGitHub 414d24893b Merge pull request #1088 from SergeyKanzhelev/linter
enable linter on repository
2025-08-13 09:41:07 -07:00
Sergey Kanzhelev a4118329f6 enable linter on repository 2025-08-13 16:12:41 +00:00
Johanan Liebermann cadd475940 Add support for Flatcar Container Linux
Signed-off-by: Johanan Liebermann <jliebermann@microsoft.com>
2025-08-11 19:03:38 +03:00
Marek Chodor a765aaecf7 feat!: Set default host address value to localhost.
Usage of `localhost` is family agnostic and will work regardless if
cluster is IPv4 or IPv6. The current value of `127.0.0.1` only works
for IPv4 clusters.

BREAKING CHANGE: It may break in rare cases where `localhost` does not
resolve as `127.0.0.1` (if OS config does not follow RFC5735 and
RFC6761).
2025-06-06 10:30:26 +00:00
Kubernetes Prow RobotandGitHub 01e1cf033e Merge pull request #1021 from nickbp/master
CodeQL / Analyze (go) (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
feat(k8sExporter): Options to allow disabling Events or Node Conditions
2025-03-10 23:57:48 -07:00
Chris Henzie 72f3041d2b Move disk and memory metrics in custom group to compute 2025-02-13 15:29:09 -08:00
Nick Parker 8d237a6c7c feat(k8sExporter): Options to allow disabling Events or Node Conditions
Both outputs are currently hardcoded to being enabled, this allows disabling one or the other. Defaults to both enabled to retain current behavior.

Larger clusters can save some etcd I/O by skipping one of these outputs if they aren't being consumed. In our case we aren't consuming the Events so writing them just creates more churn.
2025-02-04 14:53:19 +13:00
googs1025 cf0870fa12 chore: refactor custom plugin monitor method 2024-12-27 09:24:47 +08:00
googs1025 f5433f460d feature: add custom message for systemlogmonitor rule 2024-12-23 19:45:29 +08:00
googs1025 0d756b78fc chore: qps flag: use float32 instead of float64 2024-11-06 13:09:20 +08:00
googs1025 17dcc94418 feature: add QPS Burst flags 2024-10-27 21:58:45 +08:00
tashen 3a386a659e add skip list to aviod take too much efforts to translate in file log watcher 2024-10-16 10:56:15 +08:00
Ciprian Hacman 69da591e38 chore: Remove unused binary nethealth 2024-05-18 09:52:39 +03:00
Sudheer Nedlumane 7ee2a4dcda Add rocky linux support to GetOSVersion 2024-05-15 16:48:25 -07:00
Zhen Wang aed88103f1 Add comment to health checker repair function to explain the need of kill instead of restart 2024-04-05 16:56:03 +00:00
Henry Beberman fda3234b64 Add support for CBL-Mariner and Azure Linux 2024-03-28 18:34:00 +00:00
Kubernetes Prow RobotandGitHub d4aa574df2 Merge pull request #864 from linxiulei/node_cache
Get Node object from APIServer cache
2024-03-26 03:43:19 -07:00
Kubernetes Prow RobotandGitHub 8cd92dbaba Merge pull request #856 from levaspb/master
fix bug in skip_initial_status
2024-03-26 00:49:19 -07:00
Zhen Wang e4d293eb51 Bump NPD versions to v0.8.17
Also ran `make gomod` and `make fmt` in the repo for cleanup.
2024-03-09 14:32:45 +00:00
Eric Lin 7dd7c14868 Get Node object from APIServer cache 2024-02-20 14:23:13 +00:00
Chotiwat ChawannakulandGitHub 008a62bb90 fix execCommand output 2024-02-14 13:57:11 -08:00
StanislavandStanislav Egorkin f24dbb13f7 fix bug in skip_initial_status 2024-02-02 14:33:11 +01:00
Eric Lin c225435bea Use --revert-pattern to discount proactive restarts 2024-01-17 18:24:24 +00:00
Eric Lin 1002df5e13 Add --revert-pattern for logcounter 2024-01-17 18:21:57 +00:00
Kubernetes Prow RobotandGitHub bdaa44eb23 Merge pull request #825 from kasbert/master
Add disk and memory percent_used
2023-12-15 15:54:49 +01:00
Jarkko Sonninen 07900633cb Add disk and memory percent_used 2023-10-28 16:03:48 +03:00
j4ckstraw e31cf7b137 fix: fix pprof by register handlers explicitly
see https://pkg.go.dev/net/http/pprof
> By default, all the profiles listed in runtime/pprof.Profile are
available (via Handler), in addition to the Cmdline, Profile, Symbol,
and Trace profiles defined in this package. If you are not using
DefaultServeMux, you will have to register handlers with the mux you are
using.

Signed-off-by: j4ckstraw <j4ckstraw@foxmail.com>
2023-10-08 10:49:24 +08:00