From a4f64571fbd7f87c1372d2414906df9c553896d1 Mon Sep 17 00:00:00 2001 From: Philip Schmid Date: Mon, 29 Jul 2024 16:09:35 +0200 Subject: [PATCH] doc: Documentation for tetra's log level subcommand Signed-off-by: Philip Schmid --- .../content/en/docs/troubleshooting/_index.md | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/docs/content/en/docs/troubleshooting/_index.md b/docs/content/en/docs/troubleshooting/_index.md index ca3e90adb3a..99723bcf84d 100644 --- a/docs/content/en/docs/troubleshooting/_index.md +++ b/docs/content/en/docs/troubleshooting/_index.md @@ -103,24 +103,34 @@ It is possible to change the log level of Tetragon's DaemonSet Pods by setting ### Change log level dynamically -It is possible to change the log level dynamically by sending the corresponding -signal to tetragon process. +It is possible to change the log level dynamically by using the `tetra loglevel` +sub-command. `tetra` needs access to Tetragon's gRPC server endpoint which can +be configured via `--server-address`. -* Change log level to debug level by sending the `SIGRTMIN+20` signal to tetragon pid: +{{< warning >}} +Keep in mind that Tetragon's gRPC server is (by default) only exposed on +`localhost`. Also, it's important to understand that this only changes the log +level of the single Tetragon instance targeted with `--server-address` and not +all Tetragon instances when it's, for example, running as DaemonSet in a +Kubernetes environment. +{{< /warning >}} + +* Get the current log level: ```shell - sudo kill -s SIGRTMIN+20 $(pidof tetragon) + tetra loglevel get ``` -* Change log level to trace level by sending the `SIGRTMIN+21` signal to tetragon pid: +* Dynamically change the log level. Allowed values are +`[trace|debug|info|warning|error|fatal|panic]`: ```shell - sudo kill -s SIGRTMIN+21 $(pidof tetragon) + tetra loglevel set debug ``` -* To Restore the original log level send the `SIGRTMIN+22` signal to tetragon pid: +* Restore the initial log level with which Tetragon was started with (default +is `info`): ```shell - sudo kill -s SIGRTMIN+22 $(pidof tetragon) + tetra loglevel reset ``` -