Skip to content

[processor/k8sattributesprocessor] Include Container Ports and Container CPU Request in Metadata#38019

Closed
spurplewang wants to merge 12 commits into
open-telemetry:mainfrom
spurplewang:AddPortsAndCpuRequest
Closed

[processor/k8sattributesprocessor] Include Container Ports and Container CPU Request in Metadata#38019
spurplewang wants to merge 12 commits into
open-telemetry:mainfrom
spurplewang:AddPortsAndCpuRequest

Conversation

@spurplewang
Copy link
Copy Markdown

@spurplewang spurplewang commented Feb 18, 2025

Description

Include container ports and CPU request in metadata for resource attribute enrichment.

Link to tracking issue

Closes #37862

Testing

All test files were updated, followed by successful end-to-end testing.

Documentation

Updated README.md and documentation.md

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Feb 18, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@github-actions github-actions Bot added the processor/k8sattributes k8s Attributes processor label Feb 18, 2025
@spurplewang spurplewang changed the title Include Container Ports and Container CPU Requests in Metadata Include Container Ports and Container CPU Request in Metadata Feb 18, 2025
@spurplewang spurplewang changed the title Include Container Ports and Container CPU Request in Metadata [processor/k8sattributesprocessor] Include Container Ports and Container CPU Request in Metadata Feb 18, 2025
@github-actions
Copy link
Copy Markdown
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions Bot added the Stale label Mar 13, 2025
@atoulme
Copy link
Copy Markdown
Contributor

atoulme commented Mar 17, 2025

Please resolve conflicts ; please make the addition of this new data opt-in via a boolean flag in metric configuration or a feature gate. Please address the original issue comment from @TylerHelmuth regarding semantic conventions associated with these attributes.

@atoulme atoulme marked this pull request as draft March 17, 2025 21:59
@github-actions github-actions Bot removed the Stale label Mar 18, 2025
@spurplewang spurplewang marked this pull request as ready for review March 26, 2025 19:49
@andrzej-stencel
Copy link
Copy Markdown
Member

https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/13549886475/job/38924067895?pr=38019

Generated code is out of date, please run "make generate" and commit the changes in this PR.

@spurplewang can you fix the CI check errors?

@atoulme atoulme marked this pull request as draft April 7, 2025 05:08
@github-actions
Copy link
Copy Markdown
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions Bot added the Stale label Apr 21, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2025

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions Bot closed this May 5, 2025
@spurplewang
Copy link
Copy Markdown
Author

Can I have this reopened? Otherwise I can open a new one if that's preferred.

@dmitryax dmitryax reopened this May 8, 2025
@spurplewang
Copy link
Copy Markdown
Author

spurplewang commented May 8, 2025

The new data are opt-in and default off with controls in metrics config.
Renamed the container cpu request const following the planned semantic conventions update (open-telemetry/semantic-conventions#2178). The container ports doesn't have anything in semconv.

@spurplewang spurplewang marked this pull request as ready for review May 8, 2025 21:00
@github-actions github-actions Bot removed the Stale label May 9, 2025
@atoulme
Copy link
Copy Markdown
Contributor

atoulme commented May 20, 2025

Please take a look at the conflicts.

@spurplewang
Copy link
Copy Markdown
Author

Please take a look at the conflicts.

Conflicts resolved.

@antonjim-te
Copy link
Copy Markdown
Contributor

Great enhancement @spurplewang

Can we expose container memory requests?

I am happy to help on contributing on it, I can create a separate issue/pr

Thanks

Copy link
Copy Markdown
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.

I would like to raise that we need better coordination here before continuing with such additions. I'm requesting changes for now to ensure we don't prematurely merge this without having the proper discussions and alignment first.

We are adding container cpu/memory requests and limits as metrics at open-telemetry/semantic-conventions#2178. k8sclusterreceiver already reports those as metrics.

In general we are on a big effort to define all k8s related metrics the Collector uses today as Semantic Conventions: open-telemetry/semantic-conventions#1485

I see the value of having those as resource/entity attributes as well but we would need to decide on this first. Since this is a discussion needs to take place in Semantic Conventions project I would like to ask for this to happen first before continuing with the implementation.

@github-actions
Copy link
Copy Markdown
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions Bot added the Stale label Jun 10, 2025
@spurplewang
Copy link
Copy Markdown
Author

I would like to raise that we need better coordination here before continuing with such additions. I'm requesting changes for now to ensure we don't prematurely merge this without having the proper discussions and alignment first.

Thank you for flagging this—I agree that getting alignment here is the right next step. We have some immediate needs for this metadata, so I'm keen to find a path forward. Please let me know what works best to proceed.

We are adding container cpu/memory requests and limits as metrics at open-telemetry/semantic-conventions#2178. k8sclusterreceiver already reports those as metrics.

I did notice the pull request and used the name k8s.container.cpu.request for container cpu request.

In general we are on a big effort to define all k8s related metrics the Collector uses today as Semantic Conventions: open-telemetry/semantic-conventions#1485

I see the value of having those as resource/entity attributes as well but we would need to decide on this first. Since this is a discussion needs to take place in Semantic Conventions project I would like to ask for this to happen first before continuing with the implementation.

Thanks for the pointer. To ensure I contribute effectively to that discussion, could you advise on the best protocol? Is it better to comment on the main issue (#1485), or should I open a new, more focused issue in that repository that links back to it?

@spurplewang
Copy link
Copy Markdown
Author

Great enhancement @spurplewang

Can we expose container memory requests?

I am happy to help on contributing on it, I can create a separate issue/pr

Thanks

Thanks @antonjim-te ! Please feel free to create a separate issue/pr for memoey request, it would be a great addition. We might also need to wait for the alignment on semantic convention side as @ChrsMark mentioned.

@github-actions github-actions Bot removed the Stale label Jun 11, 2025
@ChrsMark
Copy link
Copy Markdown
Member

@spurplewang I think raising an issue/PR against https://github.com/open-telemetry/semantic-conventions to suggest the attributes would be the next step.

@spurplewang
Copy link
Copy Markdown
Author

@spurplewang I think raising an issue/PR against https://github.com/open-telemetry/semantic-conventions to suggest the attributes would be the next step.

Proposed open-telemetry/semantic-conventions#2357 and open-telemetry/semantic-conventions#2358. @ChrsMark , please feel free to take a look!

@github-actions
Copy link
Copy Markdown
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions Bot added the Stale label Jun 26, 2025
@github-actions
Copy link
Copy Markdown
Contributor

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions Bot closed this Jul 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

processor/k8sattributes k8s Attributes processor Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend Kubernetes Attributes Processor to support Container Ports and Container CPU Request

8 participants