-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[receiver/k8sobjectsreceiver] Handle missing objects via error_mode
#38851
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
Conversation
Not a big fan of bringing a language feature of ottl into an exporter. I think the k8sobjectsreceiver can create and maintain its own semantics. That said, will defer to codeowners. |
Yes, there are other components re-using that, but more closely related to OTTL maybe. I am fine re-implementing it for this receiver too, if that's the consensus. |
error_mode
…) handling processing of objects
…ic config (#39469) #### Description Refactor Validate() to only validate static config without external calls to Kubernetes API server as discussed in #38851 (comment) Once this is merged, the PR linked above should introduce `error_mode` implemented in `start` too. #### Link to tracking issue It is related to the issue and follow-up PR mentioned above, but it doesn't fix the issue. #### Testing I've refactored the tests in config_test.go, so we are not testing object discovery and added new tests for additional failure modes. I've build a dev images, and validated that functionality is the same as before the refactor. #### Documentation This is a "breaking change" in a sense we are changing what we are validating in Validate. The new validation logic will not fail when objects are missing. The receiver will fail the same way in this case, but in `start`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank's @krisztianfekete, overall looks good to me with few small suggestions.
Probably a make fmt
will fix the lint errors.
…related errors that should propagate regardless of error_mode
… interval in newReceiver, update README
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…open-telemetry#38851) #### Description This PR adopts a similar logic to `ottl.ErrorMode` for `k8sobjectsreceiver`, enabling users to choose between ignoring, silencing, and propagating errors for missing objects. The default is `propagate`, therefore it is backward compatible with the current state. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes open-telemetry#38803 <!--Describe what testing was performed and which tests were added.--> #### Testing Added tests, and also tested by building my own image and deployed into a Kubernetes cluster. <!--Describe the documentation added.--> #### Documentation I've updated `receiver/k8sobjectsreceiver/config.yaml` and README with the new config options. <!--Please delete paragraphs that you did not use before submitting.-->
Description
This PR adopts a similar logic to
ottl.ErrorMode
fork8sobjectsreceiver
, enabling users to choose between ignoring, silencing, and propagating errors for missing objects.The default is
propagate
, therefore it is backward compatible with the current state.Link to tracking issue
Fixes #38803
Testing
Added tests, and also tested by building my own image and deployed into a Kubernetes cluster.
Documentation
I've updated
receiver/k8sobjectsreceiver/config.yaml
and README with the new config options.