Skip to content

Commit

Permalink
docs: Document using actionset labels to extend logs
Browse files Browse the repository at this point in the history
  • Loading branch information
hairyhum committed Jul 15, 2024
1 parent e768225 commit d3d0fc2
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/tasks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ Tasks

tasks/argo.rst
tasks/logs_level.rst
tasks/logs_labels.rst
tasks/logs.rst
tasks/scaleworkload.rst
26 changes: 26 additions & 0 deletions docs/tasks/logs_labels.rst
Original file line number Diff line number Diff line change
@@ -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.



1 change: 1 addition & 0 deletions docs_new/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions docs_new/generatedSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
],
},
Expand Down
23 changes: 23 additions & 0 deletions docs_new/tasks/logs_labels.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit d3d0fc2

Please sign in to comment.