Skip to content

Commit

Permalink
extend documentation with full list of fields; fix add_resource_metad…
Browse files Browse the repository at this point in the history
…ata.deployment and add_resource_metadata.cronjob as the default value is false

Signed-off-by: Tetiana Kravchenko <[email protected]>
  • Loading branch information
tetianakravchenko committed Jan 10, 2024
1 parent a93c80d commit 00cb450
Showing 1 changed file with 153 additions and 23 deletions.
176 changes: 153 additions & 23 deletions libbeat/docs/shared-autodiscover.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ Configuration parameters:
* `node` or `namespace`: Specify labels and annotations filters for the extra metadata coming from node and namespace. By default all labels are included while annotations are not. To change default behaviour `include_labels`, `exclude_labels` and `include_annotations` can be defined. Those settings are useful when storing labels and annotations that require special handling to avoid overloading the storage output.
Note: wildcards are not supported for those settings.
The enrichment of `node` or `namespace` metadata can be individually disabled by setting `enabled: false`.
* `deployment`: If resource is `pod` and it is created from a `deployment`, by default the deployment name is added, this can be disabled by setting `deployment: false`.
* `cronjob`: If resource is `pod` and it is created from a `cronjob`, by default the cronjob name is added, this can be disabled by setting `cronjob: false`.
* `deployment`: If resource is `pod` and it is created from a `deployment`, by default the deployment name isn't added, this can be enabled by setting `deployment: true`.
* `cronjob`: If resource is `pod` and it is created from a `cronjob`, by default the cronjob name isn't added, this can be enabled by setting `cronjob: true`.
+
Example:
["source","yaml",subs="attributes"]
Expand All @@ -190,8 +190,8 @@ Example:
node:
include_labels: ["nodelabel2"]
include_annotations: ["nodeannotation1"]
deployment: false
cronjob: false
deployment: true
cronjob: true
-------------------------------------------------------------------------------------

`unique`:: (Optional) Defaults to `false`. Marking an autodiscover provider as unique results into
Expand All @@ -212,34 +212,164 @@ These are the fields available within config templating. The `kubernetes.*` fiel
====== Generic fields:
* host
* port (if exposed)
* kubernetes.labels
* kubernetes.annotations

[float]
====== Pod specific:
* kubernetes.container.id
* kubernetes.container.image
* kubernetes.container.name
* kubernetes.namespace
* kubernetes.namespace_uid
* kubernetes.node.name
* kubernetes.pod.name
* kubernetes.pod.uid
* kubernetes.pod.ip
|===
|Key |Type |Description

|`kubernetes.namespace`
|`string`
|Namespace, where the Pod is running

|`kubernetes.namespace_uuid`
|`string`
|UUID of the Namespace, where the Pod is running

|`kubernetes.namespace_labels.*`
|`object`
|Labels of the Namespace, where the Pod is running. All namespace labels are available by default, see `add_resource_metadata` configuration setting above.

|`kubernetes.namespace_annotations.*`
|`object`
|Annotations of the Namespace, where the Pod is running. Namespace annotations are not available by default, see `add_resource_metadata` configuration setting above.

|`kubernetes.pod.name`
|`string`
|Name of the Pod

|`kubernetes.pod.uuid`
|`string`
|UUID of the Pod

|`kubernetes.pod.ip`
|`string`
|IP of the Pod

|`kubernetes.labels.*`
|`object`
|Object of the Pod labels. All labels are available by default.

|`kubernetes.annotations.*`
|`object`
|Object of the Pod annotations. Annotations are not available by default.

|`kubernetes.container.name`
|`string`
|Name of the container

|`kubernetes.container.runtime`
|`string`
|Runtime of the container

|`kubernetes.container.id`
|`string`
|ID of the container

|`kubernetes.container.image`
|`string`
|Image of the container

|`kubernetes.container.port`
|`string`
|Port of the container (if defined)

|`kubernetes.container.port_name`
|`string`
|Port's name for the container (if defined)

|`kubernetes.node.name`
|`string`
|Name of the Node

|`kubernetes.node.uid`
|`string`
|UID of the Node

|`kubernetes.node.hostname`
|`string`
|Hostname of the Node

|`kubernetes.node.labels.*`
|`string`
|Labels of the Node. All node labels are available by default, see `add_resource_metadata` configuration setting above

|`kubernetes.node.annotations.*`
|`string`
|Annotations of the Node. Node annotations are not available by default, see `add_resource_metadata` configuration setting above

|`kubernetes.deployment.name.*`
|`string`
|Deployment name of the Pod (if exists). Deployment name is not available by default, see `add_resource_metadata` configuration setting above
|===

[float]
====== Node specific:
* kubernetes.node.name
* kubernetes.node.uid
* kubernetes.node.labels
|===
|Key |Type |Description

|`kubernetes.labels.*`
|`object`
|Object of labels of the Node. All labels are available by default

|`kubernetes.annotations.*`
|`object`
|Object of labels of the Node. Annotations are not available by default

|`kubernetes.node.name`
|`string`
|Name of the Node

|`kubernetes.node.uid`
|`string`
|UID of the Node

|`kubernetes.node.hostname`
|`string`
|Hostname of the Node
|===

[float]
====== Service specific:
* kubernetes.namespace
* kubernetes.namespace_uid
* kubernetes.service.name
* kubernetes.service.uid
* kubernetes.annotations
|===
|Key |Type |Description

|`kubernetes.namespace`
|`string`
|Namespace of the Service

|`kubernetes.namespace_uuid`
|`string`
|UUID of the Namespace of the Service

|`kubernetes.namespace_labels.*`
|`object`
|Labels of the Namespace of the Service. All namespace labels are available by default, see `add_resource_metadata` configuration setting above

|`kubernetes.namespace_annotations.*`
|`object`
|Annotations of the Namespace of the Service. Namespace annotations are not available by default, see `add_resource_metadata` configuration setting above

|`kubernetes.labels.*`
|`object`
|Object of the Service labels. All labels are available by default

|`kubernetes.annotations.*`
|`object`
|Object of the Service annotations. Annotations are not available by default

|`kubernetes.service.name`
|`string`
|Name of the Service

|`kubernetes.service.uid`
|`string`
|UID of the Service

|`kubernetes.selectors.*`
|`string`
|Kubernetes selectors
|===

If the `include_annotations` config is added to the provider config, then the list of annotations present in the config
are added to the event.
Expand Down

0 comments on commit 00cb450

Please sign in to comment.