-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
PoC: object annotation trace context carrier #124133
Conversation
Skipping CI for Draft Pull Request. |
Please note that we're already in Test Freeze for the Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Mon Apr 1 08:13:36 UTC 2024. |
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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 |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dashpole 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 |
// Extract reads context from the object into the returned Context using the | ||
// global propagators. | ||
// This should be called when reconciling an object before starting any spans. | ||
func ExtractContext(ctx context.Context, object metav1.Object) context.Context { |
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.
how is this context passed to ExtractContext
available to all the controllers? is it some kind of global context?
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.
This accepts a context argument in-case the controller already has a context. Most of the time, controllers will probably use a context.Background(). But if the controller is already propagating a context (e.g. for passing metadata to contextual logs), this ensures the two can be merged together (since we can add to an existing context, rather than requiring a new one.
What type of PR is this?
/kind feature
What this PR does / why we need it:
Example implementation of context propagation using object annotations as the carrier. This would enable linking kubelet spans to spans from other controllers.
ExtractContext
gets the context from an object (this will be in the w3c traceparent format).InjectContext
adds the context to an object.Which issue(s) this PR fixes:
Special notes for your reviewer:
This is similar to ideas documented in kubernetes/enhancements#2312.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
@richabanker @logicalhan @tallclair @dgrisonnet