Skip to content

Commit

Permalink
processor/k8sattributes: Add resource_attributes to metadata.yaml
Browse files Browse the repository at this point in the history
This PR adds the resource attributes added by the k8sattributes processor to the metadata.yaml file in the resource_attributes group. Only the attributes which are added by default (see [documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.79.0/processor/k8sattributesprocessor#configuration)) are marked as enabled.

The generated config structs are not used, as resource attributes are exposed through a different configuration interface. This is noted in the metadata.yaml file.

Fixes: open-telemetry#23152.
  • Loading branch information
mackjmr committed Jun 7, 2023
1 parent e4c3488 commit 43c0d45
Show file tree
Hide file tree
Showing 4 changed files with 371 additions and 0 deletions.
101 changes: 101 additions & 0 deletions processor/k8sattributesprocessor/internal/metadata/generated_config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
default:
all_set:
resource_attributes:
container.id:
enabled: true
container.image.name:
enabled: true
container.image.tag:
enabled: true
k8s.container.name:
enabled: true
k8s.cronjob.name:
enabled: true
k8s.daemonset.name:
enabled: true
k8s.daemonset.uid:
enabled: true
k8s.deployment.name:
enabled: true
k8s.deployment.uid:
enabled: true
k8s.job.name:
enabled: true
k8s.job.uid:
enabled: true
k8s.namespace.name:
enabled: true
k8s.node.name:
enabled: true
k8s.pod.hostname:
enabled: true
k8s.pod.name:
enabled: true
k8s.pod.start_time:
enabled: true
k8s.pod.uid:
enabled: true
k8s.replicaset.name:
enabled: true
k8s.replicaset.uid:
enabled: true
k8s.statefulset.name:
enabled: true
k8s.statefulset.uid:
enabled: true
none_set:
resource_attributes:
container.id:
enabled: false
container.image.name:
enabled: false
container.image.tag:
enabled: false
k8s.container.name:
enabled: false
k8s.cronjob.name:
enabled: false
k8s.daemonset.name:
enabled: false
k8s.daemonset.uid:
enabled: false
k8s.deployment.name:
enabled: false
k8s.deployment.uid:
enabled: false
k8s.job.name:
enabled: false
k8s.job.uid:
enabled: false
k8s.namespace.name:
enabled: false
k8s.node.name:
enabled: false
k8s.pod.hostname:
enabled: false
k8s.pod.name:
enabled: false
k8s.pod.start_time:
enabled: false
k8s.pod.uid:
enabled: false
k8s.replicaset.name:
enabled: false
k8s.replicaset.uid:
enabled: false
k8s.statefulset.name:
enabled: false
k8s.statefulset.uid:
enabled: false
87 changes: 87 additions & 0 deletions processor/k8sattributesprocessor/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,90 @@ status:
stability:
beta: [logs, metrics, traces]
distributions: [contrib, splunk, observiq, sumo]

# resource attributes are exposed through a different configuration interface (extract::metadata).
resource_attributes:
k8s.namespace.name:
description: The name of the namespace that the pod is running in.
type: string
enabled: true
k8s.pod.name:
description: The name of the Pod.
type: string
enabled: true
k8s.pod.uid:
description: The UID of the Pod.
type: string
enabled: true
k8s.pod.hostname:
description: The hostname of the Pod.
type: string
enabled: false
k8s.pod.start_time:
description: The start time of the Pod.
type: string
enabled: true
k8s.deployment.name:
description: The name of the Deployment.
type: string
enabled: true
k8s.deployment.uid:
description: The UID of the Deployment.
type: string
enabled: false
k8s.replicaset.name:
description: The name of the ReplicaSet.
type: string
enabled: false
k8s.replicaset.uid:
description: The UID of the ReplicaSet.
type: string
enabled: false
k8s.daemonset.name:
description: The name of the DaemonSet.
type: string
enabled: false
k8s.daemonset.uid:
description: The UID of the DaemonSet.
type: string
enabled: false
k8s.statefulset.name:
description: The name of the StatefulSet.
type: string
enabled: false
k8s.statefulset.uid:
description: The UID of the StatefulSet.
type: string
enabled: false
k8s.container.name:
description: The name of the Container in a Pod template.
type: string
enabled: false
k8s.job.name:
description: The name of the Job.
type: string
enabled: false
k8s.job.uid:
description: The UID of the Job.
type: string
enabled: false
k8s.cronjob.name:
description: The name of the CronJob.
type: string
enabled: false
k8s.node.name:
description: The name of the Node.
type: string
enabled: true
container.id:
description: Container ID. Usually a UUID, as for example used to identify Docker containers. The UUID might be abbreviated.
type: string
enabled: false
container.image.name:
description: Name of the image the container was built on.
type: string
enabled: false
container.image.tag:
description: Container image tag.
type: string
enabled: false

0 comments on commit 43c0d45

Please sign in to comment.