-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add k8s util functions for aws container insights #3367
Add k8s util functions for aws container insights #3367
Conversation
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.
Can you describe what is AWS specific about this code? Also, what are the differences vs k8sprocessor
? https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/k8sprocessor
Some background:In the upstream, there are two components that calls k8s api server:
DifferenceContainer insights implementation is different on the following two aspects:
|
So the main question becomes how can we share between
Is this a useful optimization for the k8sclusterreceiver? If so we should do it
If these permissions are too open, then as a best practice allowing this to be configured in
Seems like this can be added incrementally rather than having duplication of every k8s resource fetch
This is a sort of transformation. It'd be great to have a single source of truth about k8s cluster information in the collector codebase, probably outside the scope of a receiver (so e.g., Since this code is being added to this upstream repo now, we need to take advantage of it to make sure we add in a way that fits in with the rest of the components. kubernetes is a standard, so it's sort of a "code smell" to see so much duplication between k8s parts. |
I agree that otel should have some common utils for get metrics/metadata about kubernetes resources. But given the current situation in which three components (including aws container insights) all has some duplicate functionalities there, it would be quite a time-consuming task to refactor them into a single place. In addition, we might also need to involve the owners of
Does it sound ok to you? |
I would want some sort of roadmap for 2) I think. We can't have the collector just be a dumping ground of code, it's a place where we commit to working on making the collector a better place. Issues such as the use of OpenCensus APIs in AWS components have been known for a long time but are only now being fixed after being forced by API removal. I'm skeptical the duplication would ever get fixed if just filing an issue. @bogdandrutu @tigrannajaryan Does this way of thinking align with where you want the collector to go? |
I created a feature request #3424 about this issue. As it seems to be a big task which might take a long time, I think we should focus on the current code and plan for future improvement. |
I discussed the feature request #3424 in otel sync up meeting. It seems like refactoring out a common k8s utils for otel is a long term goal. That involves two aspects:
|
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!
Description:
Add the util functions to call k8s api server to get information about
The "List & Watch" api of
cache.Reflector
is used to monitor the incremental changes of resources. The benefit is that we can get resource information update in time. If the resources just occasionally slightly changes, the impact to API server is supposed to be minimal.Link to tracking Issue:
#2307
Testing:
Unit tests