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

k8sobjects receiver fails when some unrelated Kubernetes API is down #29706

Closed
povilasv opened this issue Dec 8, 2023 · 2 comments
Closed

k8sobjects receiver fails when some unrelated Kubernetes API is down #29706

povilasv opened this issue Dec 8, 2023 · 2 comments
Assignees
Labels

Comments

@povilasv
Copy link
Contributor

povilasv commented Dec 8, 2023

Component(s)

receiver/k8sobjects

What happened?

Description

When unrelated Kubernetes API is down K8s Discovery client.ServerPreferredResources() will return a partial result and an error, we should ignore the error if it's unrelated.

Error: invalid configuration: receivers::k8sobjects: unable to retrieve the complete list of server APIs: metrics.k8s.io/v1beta1: the server is currently unable to handle the request

Steps to Reproduce

Install metrics-server and delete deployment, launch k8sobjectreceiver to collect events.

Expected Result

no crashes

Actual Result

crashes with the error

Error: invalid configuration: receivers::k8sobjects: unable to retrieve the complete list of server APIs: metrics.k8s.io/v1beta1: the server is currently unable to handle the request

Collector version

v0.90.1

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

k8sobjects:
        objects:
        - exclude_watch_type:
          - DELETED
          group: events.k8s.io
          mode: watch
          name: events

Log output

Error: invalid configuration: receivers::k8sobjects: unable to retrieve the complete list of server APIs: metrics.k8s.io/v1beta1: the server is currently unable to handle the request

Additional context

No response

@povilasv povilasv added bug Something isn't working needs triage New item requiring triage labels Dec 8, 2023
Copy link
Contributor

github-actions bot commented Dec 8, 2023

Pinging code owners:

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

@povilasv povilasv changed the title k8sobject receiver fails when some unrelated Kubernetes API is down k8sobjects receiver fails when some unrelated Kubernetes API is down Dec 8, 2023
@TylerHelmuth TylerHelmuth added priority:p2 Medium and removed needs triage New item requiring triage labels Dec 8, 2023
TylerHelmuth pushed a commit that referenced this issue Dec 11, 2023
…wn (#29707)

**Description:** <Describe what has changed.>

This change allows passing validation even some of K8S APIs is down, we
will look thru the groups and resources for the ones available.


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

**Link to tracking Issue:** <Issue number if applicable>


#29706

**Testing:** <Describe what testing was performed and which tests were
added.>
- manually in a kind cluster with metrics-server being down.

**Documentation:** <Describe the documentation added.>
Copy link
Contributor

github-actions bot commented Feb 7, 2024

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 Feb 7, 2024
@povilasv povilasv closed this as completed Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants