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

k8sclusterreceiver: Fetch namespace scoped metrics from the Master API #9401

Closed
harnitsignalfx opened this issue Apr 21, 2022 · 11 comments · Fixed by #35727
Closed

k8sclusterreceiver: Fetch namespace scoped metrics from the Master API #9401

harnitsignalfx opened this issue Apr 21, 2022 · 11 comments · Fixed by #35727
Assignees
Labels
comp: receiver Receiver enhancement New feature or request help wanted Extra attention is needed never stale Issues marked with this label will be never staled and automatically removed priority:p2 Medium receiver/k8scluster

Comments

@harnitsignalfx
Copy link

Is your feature request related to a problem? Please describe.
The k8sclusterreceiver today is set to fetch metrics from the k8s master API at the cluster scope level. In cases where we'd like to deploy the otel-collector as a sidecar, there is no mechanism to fetch metrics scoped to the namespace level. E.g. The pod phases and pod restarts for the namespace the collector is deployed in as a sidecar.

Ideally, there is a sidecar deployment model for the collector where the k8sclusterreceiver and the kubeletstatsreceiver both fetch data only related to the pod they are deployed on. This will help immensely for developers who do not have access to leverage ClusterRoles and are restricted to a certain set of namespaces.

Describe the solution you'd like
The receiver should have a flag to restrict fetching data from the namespace it is deployed in.

Describe alternatives you've considered
I tried setting a namespace scoped Role for the serviceAccount on the k8sclusterreceiver. It unfortunately still hits the /api/v1/pods endpoint and I'd like to use the /api/v1/namespaces/<namespace-name>/pods endpoint.

@dmitryax dmitryax added enhancement New feature or request comp: receiver Receiver priority:p2 Medium help wanted Extra attention is needed good first issue Good for newcomers and removed good first issue Good for newcomers labels Apr 21, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Nov 8, 2022

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@github-actions github-actions bot added the Stale label Nov 8, 2022
@fatsheep9146
Copy link
Contributor

I think this may also be blocked by #15651 ? @dmitryax

@fatsheep9146 fatsheep9146 removed the Stale label Nov 8, 2022
@dmitryax
Copy link
Member

I think this may also be blocked by #15651 ? @dmitryax

Right. We desperately need e2e tests before we introduce any new changes to k8s components

@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@github-actions github-actions bot added the Stale label Jan 10, 2023
@fatsheep9146 fatsheep9146 added never stale Issues marked with this label will be never staled and automatically removed and removed Stale never stale Issues marked with this label will be never staled and automatically removed labels Jan 10, 2023
@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@github-actions
Copy link
Contributor

Pinging code owners for receiver/k8scluster: @dmitryax. See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Jul 17, 2023
@dmitryax dmitryax added the never stale Issues marked with this label will be never staled and automatically removed label Jul 19, 2023
@dmitryax dmitryax changed the title k8sclusterreceiver: Fetch namespace scoped metrics from the Master API for sidecar implementation k8sclusterreceiver: Fetch namespace scoped metrics from the Master API Jul 19, 2023
@bacherfl
Copy link
Contributor

bacherfl commented Oct 9, 2024

Is this issue still relevant? From what I have seen in the docs and implementation this is not implemented yet, so I would like to work on a PR for this

@ChrsMark
Copy link
Member

I think that's still open yes. @bacherfl I' assigning this to you, thank's!

@bacherfl
Copy link
Contributor

I think that's still open yes. @bacherfl I' assigning this to you, thank's!

Thanks @ChrsMark! The PR should be ready for review now

RutvikS-crest pushed a commit to RutvikS-crest/opentelemetry-collector-contrib that referenced this issue Dec 9, 2024
…fic namespace (open-telemetry#35727)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

This PR extends the k8scluster receiver with an option to limit the
observed resources to a specific namespace.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#9401 

<!--Describe what testing was performed and which tests were added.-->
#### Testing

added unit and e2e tests

<!--Describe the documentation added.-->
#### Documentation

Added section about how to make use of Roles and RoleBindings instead of
ClusterRoles and ClusterRoleBindings

---------

Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
sbylica-splunk pushed a commit to sbylica-splunk/opentelemetry-collector-contrib that referenced this issue Dec 17, 2024
…fic namespace (open-telemetry#35727)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

This PR extends the k8scluster receiver with an option to limit the
observed resources to a specific namespace.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#9401 

<!--Describe what testing was performed and which tests were added.-->
#### Testing

added unit and e2e tests

<!--Describe the documentation added.-->
#### Documentation

Added section about how to make use of Roles and RoleBindings instead of
ClusterRoles and ClusterRoleBindings

---------

Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: receiver Receiver enhancement New feature or request help wanted Extra attention is needed never stale Issues marked with this label will be never staled and automatically removed priority:p2 Medium receiver/k8scluster
Projects
None yet
5 participants