From d3d0fc2bc909ffe18cecb527406f7c1fc009f2d3 Mon Sep 17 00:00:00 2001 From: Daniil Fedotov Date: Mon, 15 Jul 2024 15:57:26 -0400 Subject: [PATCH] docs: Document using actionset labels to extend logs --- docs/tasks.rst | 1 + docs/tasks/logs_labels.rst | 26 ++++++++++++++++++++++++++ docs_new/.vitepress/config.mts | 1 + docs_new/generatedSidebar.js | 1 + docs_new/tasks/logs_labels.md | 23 +++++++++++++++++++++++ 5 files changed, 52 insertions(+) create mode 100644 docs/tasks/logs_labels.rst create mode 100644 docs_new/tasks/logs_labels.md diff --git a/docs/tasks.rst b/docs/tasks.rst index 284b1ac1d01..f42eb5e02b7 100644 --- a/docs/tasks.rst +++ b/docs/tasks.rst @@ -7,5 +7,6 @@ Tasks tasks/argo.rst tasks/logs_level.rst + tasks/logs_labels.rst tasks/logs.rst tasks/scaleworkload.rst diff --git a/docs/tasks/logs_labels.rst b/docs/tasks/logs_labels.rst new file mode 100644 index 00000000000..7b98cd0da85 --- /dev/null +++ b/docs/tasks/logs_labels.rst @@ -0,0 +1,26 @@ +Configuring logs for specific ActionSets +---------------------------- + +Kanister uses structured logging to ensure that its logs can be easily +categorized, indexed and searched by downstream log aggregation software. + +Extra fields can be added to log records for specific ActionSet. +To do that the ActionSet needs to have a label with the ``kanister.io/`` prefix. + +For example: + +.. code-block:: yaml + :linenos: + apiVersion: cr.kanister.io/v1alpha1 + kind: ActionSet + metadata: + namespace: kanister + name: myActionSet + labels: + kanister.io/myFieldName: myFieldValue + +All logs concerning this ActionSet execution will have +``myFieldName`` field with ``myFieldValue`` value. + + + diff --git a/docs_new/.vitepress/config.mts b/docs_new/.vitepress/config.mts index baf5696abaa..eabacc99337 100644 --- a/docs_new/.vitepress/config.mts +++ b/docs_new/.vitepress/config.mts @@ -39,6 +39,7 @@ export default defineConfig({ link: "/tasks/logs", }, { text: "Modifying Kanister Log Level", link: "/tasks/logs_level" }, + { text: "Configuring logs for specific ActionSets", link: "/tasks/logs_labels" }, { text: "Using ScaleWorkload function with output artifact", link: "/tasks/scaleworkload", diff --git a/docs_new/generatedSidebar.js b/docs_new/generatedSidebar.js index 2d47e44dae3..db979ec562d 100644 --- a/docs_new/generatedSidebar.js +++ b/docs_new/generatedSidebar.js @@ -13,6 +13,7 @@ module.exports = [ { text: "Argo.md", link: "/tasks/argo" }, { text: "Logs.md", link: "/tasks/logs" }, { text: "Logs_level.md", link: "/tasks/logs_level" }, + { text: "logs_labels.md", link: "/tasks/logs_labels" }, { text: "Scaleworkload.md", link: "/tasks/scaleworkload" }, ], }, diff --git a/docs_new/tasks/logs_labels.md b/docs_new/tasks/logs_labels.md new file mode 100644 index 00000000000..4cda2c2e877 --- /dev/null +++ b/docs_new/tasks/logs_labels.md @@ -0,0 +1,23 @@ +# Configuring logs for specific ActionSets + +Kanister uses structured logging to ensure that its logs can be easily +categorized, indexed and searched by downstream log aggregation software. + +Extra fields can be added to log records for specific ActionSet. +To do that the ActionSet needs to have a label with the `kanister.io/` prefix. + +For example: + +``` yaml + apiVersion: cr.kanister.io/v1alpha1 + kind: ActionSet + metadata: + namespace: kanister + name: myActionSet + labels: + kanister.io/myFieldName: myFieldValue + +``` + +All logs concerning this ActionSet execution will have +`myFieldName` field with `myFieldValue` value. \ No newline at end of file