Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add k8s entity attributes #1693

Open
jinja2 opened this issue Dec 17, 2024 · 0 comments
Open

Add k8s entity attributes #1693

jinja2 opened this issue Dec 17, 2024 · 0 comments
Labels
area:k8s enhancement New feature or request

Comments

@jinja2
Copy link

jinja2 commented Dec 17, 2024

Area(s)

area:k8s

Is your change request related to a problem? Please describe.

K8scluster receiver currently emits entity events for k8s objects. We are working on adding descriptive attributes (values may be mutable) to k8s entities. I'd like to use this issue to track existing and any new attributes to k8s entities.

Describe the solution you'd like

Add following attributes for k8s.pod -

  • k8s.pod.phase - The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle. Possible Values - Pending, Running, Succeeded, Failed, Unknown.
  • k8s.pod.status_reason - A brief CamelCase message indicating details about why the pod is in this state. e.g. value Evicted.
  • k8s.workload.kind - k8s workload kind associated with the pod. E.g. values - Deployment, CronJob, StatefulSet, Node. For pods associated with a deployment, the value of this attribute will be Deployment even though the true owner of the pod as seen in metadata.ownerReferences is ReplicaSet.
  • k8s.workload.uid - The uid for the workload associated with this pod.
  • k8s.pod.creation_timestamp - Pod's creation time in RFC3339 format. E.g. value - 2020-06-18T17:24:53Z

Attributes for k8s.node -

  • k8s.node.condition_{type} - Attributes for node condition types set by kubelet in response to node resource pressure. Possible values for below attributes are false, true and unknown
    • k8s.node.conditon_ready
    • k8s.node.condition_memory_pressure
    • k8s.node.condition_network_unavailable
    • k8s.node.condition_pid_pressure
    • k8s.node.condition_disk_pressure
  • k8s.node.creation_timestamp - Node's creation time in RFC3339 format. E.g. value - 2020-06-18T17:24:53Z

Describe alternatives you've considered

No response

Additional context

These are experimental attributes sent as part of entity events from the k8scluster receiver. Majority of these are mutable and meant to be used in descriptive capacity. We'd like to use this issue to track attributes used in the experimental entity type in k8s receivers.

@jinja2 jinja2 added enhancement New feature or request triage:needs-triage labels Dec 17, 2024
dmitryax pushed a commit to open-telemetry/opentelemetry-collector-contrib that referenced this issue Jan 6, 2025
#### Description

Adds below additional metadata attributes to the node and pod entity -

k8s.pod.phase - This is similar to the existing metric k8s.pod.phase.
The values can be Pending, Running, Succeeded, Failed, Unknown.
k8s.pod.status_reason - Similar to k8s.pod.status_reason metric. A brief
CamelCase message indicating details about why the pod is in this state.
Example values - Evicted, NodeLost, UnexpectedAdmissionError
k8s.node.condition_{type} - similar to existing metrics enabled by the
config node_conditions_to_report, e.g. k8s.node.condition_ready. Add
[k8s default kubelet
conditions](https://pkg.go.dev/k8s.io/api/core/v1#NodeConditionType)
only.

We'll be tracking changes to entitiy attributes for k8s in
[this](open-telemetry/semantic-conventions#1693)
SemConv issue.

#### Link to tracking issue
Fixes - #36859

#### Testing
Added unit tests and verified in cluster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:k8s enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

2 participants