Overview
By adding Kubernetes-specific attributes to telemetry signals, you can gain better visibility into workloads running in the cluster. Helps in correlating traces, logs and metrics with specific Kubernetes resources, such as pods, deployments, nodes and clusters. Adding resource attributes based on custom kubernetes annotations/labels can enrich the data with user defined aggregations and metadata corresponding to the originating pod that produced the telemetry.Configuration Options
The K8sAttributes action is configured using theodigos.io/v1alpha1.Action CRD with the k8sAttributes configuration section.
actionName
actionName
actionName
string : Allows you to attach a meaningful name to the action for convenience.- This field is optional
- Odigos does not use or assume any meaning from this field
notes
notes
notes
string : Allows you to attach notes regarding the action for convenience.- This field is optional
- Odigos does not use or assume any meaning from this field
disabled
disabled
disabled
boolean : Allows you to temporarily disable the action, but keep it saved for future use.- This field is optional, and defaults to
false
signals *
signals *
signals
string[] : An array with the signals that the action will operate on.- This field is required
- Supported values:
TRACES, LOGS, METRICS
k8sAttributes *
k8sAttributes *
k8sAttributes
object : Configuration for the K8sAttributes action.- This field is required for this action type
collectContainerAttributes
collectContainerAttributes
collectContainerAttributes
boolean : Collect the following container related attributes:k8s.container.namecontainer.idcontainer.image.namecontainer.image.tag
falsecollectReplicaSetAttributes
collectReplicaSetAttributes
collectReplicaSetAttributes
boolean : Collect the following replica set related attributes:k8s.replicaset.nameif CollectWorkloadUID is set to true, the following attribute will be collected as well:k8s.replicaset.uid
falseCollectWorkloadUID
CollectWorkloadUID
CollectWorkloadUID
boolean : Collect the workload UID:k8s.deployment.uidk8s.daemonset.uidk8s.statefulset.uid
falseCollectClusterUID
CollectClusterUID
CollectClusterUID
boolean : Collect the k8s.cluster.uid attribute, which is set to the uid of the namespace “kube-system”. This allows aggregating observability based on the cluster it originated from.This field is optional and defaults to falselabelsAttributes
labelsAttributes
labelsAttributes
K8sLabelAttribute[] : Collect resource attributes based on the specified labels. The labels are taken from the Pod which emits the telemetry. Missing labels will be ignored.This field is optional and can remain empty.annotationsAttributes
annotationsAttributes
labelsAttributes
K8sAnnotationAttribute[] : Collect resource attributes based on the specified annotation. The annotations are taken from the Pod which emits the telemetry. Missing annotations will be ignored.This field is optional and can remain empty.Basic Example
The following example demonstrates how to collect Kubernetes attributes, including labels and annotations, and attach them to telemetry signals using the new Action CRD.1
Create a YAML file with the following content:
k8s-attributes.yaml
2
Apply the action to the cluster: