-
Notifications
You must be signed in to change notification settings - Fork 669
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
added otel capabilities for descheduler plugin #958
added otel capabilities for descheduler plugin #958
Conversation
Skipping CI for Draft Pull Request. |
/assign @Dentrax |
@harshanarayana: GitHub didn't allow me to assign the following users: Dentrax. Note that only kubernetes-sigs members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/cc @Dentrax |
@harshanarayana: GitHub didn't allow me to request PR reviews from the following users: Dentrax. Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
fdcafea
to
60a9747
Compare
type RunFunc func(ctx context.Context, nodes []*v1.Node) *framework.Status | ||
|
||
// RunPlugin runs a plugin. | ||
func RunPlugin(plugin framework.Plugin, runFn RunFunc, operationName, pluginName string) func(ctx context.Context, nodes []*v1.Node) { |
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.
rather than wrapping the plugin's function in a span, why not start and close the span within the plugin's Deschedule
function?
I would prefer if traces are implemented by the plugins themselves rather than the framework. The framework can provide the mechanisms (like registering a global traceprovider) but I would leave the actual spans up to plugin developers to implement
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.
My initial attempt was to put Span login within each plugin individually. And then I thought it could hard to maintain if we manage tracing stuff separately:
- it would be easy to forget to put tracing logic in a function
- it would bring code duplication (1 line tracing, 1 line defer: times plugin count)
- it would be easy to forget to add
span.RecordError(status.Err)
function in all error cases - should plugins really know the existence of tracing? (why plugin developers should duplicate this logic?)
These are just my concern, I'm OK to go with your way anyway. Wanted to learn more about your concern. 🤞
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.
should plugins really know the existence of tracing? (why plugin developers should duplicate this logic?)
One benefit of a framework model is detangling the plugin logic from the surrounding framework internals, so in that sense the answer is yes.
On that end, it makes sense for us to start a parent trace in our internals (somewhere around here), and plugins can use the context to add whatever additional spans they want. But the responsibilities of good design you mention in your other bullet points are kept to the individual plugin developers
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.
On that end, it makes sense for us to start a parent trace in our internals (somewhere around here),
+1 from me for this. I think we can start from this for now and see how it goes. Enforcing the tracing related code can be done mostly during the code review of a new plugin getting added anyway. The current code in the repo already lets us create the parent trace and pass the context down to the individual plugin/strategies so that they can trace the required bit of the code in that accordingly.
This will also leave the plugin developer with freedom of being able to trace some of their internal helper/util functions as well if required.
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.
@harshanarayana yup, that's exactly what I'm thinking
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.
6801733
to
d37ab93
Compare
@@ -22,6 +22,7 @@ import ( | |||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||
componentbaseconfig "k8s.io/component-base/config" | |||
registry "k8s.io/component-base/logs/api/v1" | |||
"sigs.k8s.io/descheduler/pkg/apis/componentconfig" |
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.
the versioned API shouldn't import the unversioned API. it's a hub-and-spoke model for conversion, so you should basically duplicate the types into the versioned api here
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.
/Ack. I am working on getting this changed. Will publish a copy of this by tomorrow. @damemi
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.
Changes done.
/cc @damemi |
/test pull-descheduler-verify-master |
0f1a622
to
115bab4
Compare
/test pull-descheduler-verify-master |
Unable to figure out why this issue on the CICD showing up. ❯ hack/verify-conversions.sh
hack/uGenerated conversions verified.
if I run the verify locally, it works just fine! |
@harshanarayana I checked out your branch locally and it fails when I run it with the same output as the CI. Could you try running |
@mikedanese That is definitely weird. I did that already and I see not delta in the commits or files! :( |
@harshanarayana I think it has something to do with #982, but I can't quite figure it out. Posted a more detailed explanation there |
@damemi Thanks very much. Definitely looks like the same. Let me run the same generation code in a different machine I have and see if actually makes a difference. Do you think it matters where my code resides though? Mine doesn't exists under the |
tracing: pass start span func to all plugins Signed-off-by: Furkan <furkan.turkal@trendyol.com> tracing: pass span context to run func Signed-off-by: Furkan <furkan.turkal@trendyol.com> move tracing workflow to individual plugins handle shutdown handling for context cancel enable hub/spoke mode for the OTEL config conversion add tests for tracing Signed-off-by: Furkan <furkan.turkal@trendyol.com> update generated conversion data model update generated conversion spec fix deepcopy gen behavior gofumpt cleanup for formatting format descheduler.go Signed-off-by: Furkan <furkan.turkal@trendyol.com> use same context instead creating a new one Signed-off-by: Furkan <furkan.turkal@trendyol.com> update vendoring to match the upstream branches regenerated auto generated code for new copyright for verify match Signed-off-by: Harsha Narayana <harshnar@cisco.com> fix klog ErrorS invocation cleanup vendor and mod files reuse existing context against trace spans and fix the structs update conversion
Signed-off-by: Furkan <furkan.turkal@trendyol.com>
f39dfc2
to
312d8f8
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@harshanarayana: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/cc @damemi @ingvagabund @knelasevero Has the 0.27 🚢 sailed or do you think we can squeeze this in? |
@a7i this needs a rebase and there is still some unaddressed feedback. I would say let's release 0.27 and target this for 0.28 |
@damemi I've addressed most of the comments already. Let me tenses again and push changes.. I'm fine with moving this to 0.28 |
@harshanarayana I bumped the comments that I noticed that still need to be fixed from when we left this off |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale @harshanarayana apologies for the delay on this review. would be good to include this as part of next release. would you be able to address the issues above? I can also address if you are ok with that. |
@a7i I will take care of this. I might just close and re-create a new PR entirely with a clean slate and keep a reference for this to track the history of discussion. I will have a PR ready for you in a day or two. |
Closing this in favor of #1189 |
Note
Early Draft of the PR to get feedbacks on. This is not yet ready for full review.
Fixes: #951