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

[receiver/k8scluster] add attributes to node and pod entities #36862

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jinja2
Copy link
Contributor

@jinja2 jinja2 commented Dec 16, 2024

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 only.

We'll be tracking changes to entitiy attributes for k8s in this SemConv issue.

Link to tracking issue

Fixes - #36859

Testing

Added unit tests and verified in cluster

Documentation

@jinja2 jinja2 marked this pull request as ready for review December 16, 2024 21:53
@jinja2 jinja2 requested a review from a team as a code owner December 16, 2024 21:53
@jinja2 jinja2 force-pushed the add-k8scluster-attr branch from b9be8c2 to 226670f Compare December 17, 2024 05:50
"foo1": "",
"k8s.node.name": "test-node-1",
"node.creation_timestamp": "0001-01-01T00:00:00Z",
"k8s.node.condition_disk_pressure": "false",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't those first go through Semantic Conventions?

We have been blocking PRs adding new metrics or attributes in k8s components asking for SemConv definition first. Not sure if this has changed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are experimental entity attributes. They are aligned with the existing metrics. It can be easily changed later since it's experimental

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to define such attributes in SemConv first even if we don't have entity signal yet?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These won't be eligible as resource attributes due to values being mutable. And I tried to align with our existing stuff. But if we are ready to start with enitities in semantic conventions then I'd be happy to add these.

Copy link
Member

@ChrsMark ChrsMark Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe those would make sense to be defined in the attributes' registry first? (It's a chicken-egg problem)

Having a specific guideline about what we "allow" to be added directly and what not would help here. I'm not sure if we have sth like this right now. I guess we haven't.

Since entity signal is not yet defined maybe it would be just fine if we merge them and file an issue against SemConv to keep track of them making clear the reason why those were added to the receiver now. This issue could be used for reference in the future if there are more requests for additional attributes?

I don't have strong preference here, just want to ensure consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since entity signal is not yet defined maybe it would be just fine if we merge them and file an issue against SemConv to keep track of them making clear the reason why those were added to the receiver now. This issue could be used for reference in the future if there are more requests for additional attributes?

Your idea sounds good! This will help us make progress on the experimental entities (and hopeful encourage its usage) while still tracking the new additions. I'll start an issue on SemConv.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me. Let's have a tracking issue for k8s entity attributes that we have in the collector. The issue will be essentially blocked until we have the signal ready.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@ChrsMark ChrsMark Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank's! Please consider adding this in the PR description as well for easier future reference.

receiver/k8sclusterreceiver/internal/node/nodes.go Outdated Show resolved Hide resolved
"foo1": "",
"k8s.node.name": "test-node-1",
"node.creation_timestamp": "0001-01-01T00:00:00Z",
"k8s.node.condition_disk_pressure": "false",
Copy link
Member

@ChrsMark ChrsMark Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank's! Please consider adding this in the PR description as well for easier future reference.

@jinja2 jinja2 changed the title [receiver/k8scluster] add attributes to node and pod metadata [receiver/k8scluster] add attributes to node and pod enitities Dec 18, 2024
@jinja2 jinja2 changed the title [receiver/k8scluster] add attributes to node and pod enitities [receiver/k8scluster] add attributes to node and pod entities Dec 18, 2024
@jinja2 jinja2 force-pushed the add-k8scluster-attr branch from e8d0b6c to 5582d26 Compare December 18, 2024 11:13
Copy link
Member

@ChrsMark ChrsMark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants