Skip to content

Conversation

@Rishab-And-Abhisekh-joint

Description:
Fixes #43865. Previously, k8s.node.uid was only added if k8s.node.name was also requested in the configuration. This PR decouples the logic so UID can be fetched independently.

Testing:
Added a unit test case validating k8s.node.uid is present even when k8s.node.name is omitted.

Credit:
Logic based on investigation by @LeonLow97.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 11, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: Rishab-And-Abhisekh-joint / name: Rishab_Acharjee (a4960d9, 2fe8237)

@github-actions github-actions bot added the first-time contributor PRs made by new contributors label Jan 11, 2026
@github-actions
Copy link
Contributor

Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib.

Important reminders:

A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better!

@github-actions github-actions bot added the processor/k8sattributes k8s Attributes processor label Jan 11, 2026
@github-actions github-actions bot requested a review from odubajDT January 11, 2026 11:25
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.

Please remove the unnecessary additions. Otherwise it looks good.

Copy link
Member

Choose a reason for hiding this comment

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

Sth looks weird.

Choose a reason for hiding this comment

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

Thanks for the catch @ChrsMark. I realized the issue was that I was initializing the client (c) outside the loop, which caused shared state between the test cases.

I’ve moved the client initialization inside t.Run so each test case starts with a clean state. I also removed the commented-out code and ran make fmt. Ready for another look!

Copy link
Member

Choose a reason for hiding this comment

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

I don't see why we need to change the existing tests for this patch.

The current state of the PR is incomplete since the actual fix has been reverted since I approved the PR.

Please ensure that the PR is actually ready for review with only the required/necessary changes implemented.

@ChrsMark ChrsMark marked this pull request as draft January 14, 2026 13:23
@Rishab-And-Abhisekh-joint Rishab-And-Abhisekh-joint marked this pull request as ready for review January 19, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[processor/k8sattributes] k8s.node.name attribute is required to set k8s.node.uid

4 participants