-
Notifications
You must be signed in to change notification settings - Fork 40k
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 distributed tracing to the etcd client #103216
Conversation
Skipping CI for Draft Pull Request. |
/sig instrumentation |
/priority important-soon |
/test all |
f0da0b3
to
04fabac
Compare
/test all |
04fabac
to
71f810b
Compare
/test all |
/retest |
1 similar comment
/retest |
/retest |
/cc @kubernetes/sig-instrumentation-leads @lilic |
/assign @lilic @logicalhan |
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
/triage accepted |
/assign @liggitt |
dialOptions = append(dialOptions, | ||
grpc.WithUnaryInterceptor(otelgrpc.UnaryClientInterceptor(tracingOpts...)), | ||
grpc.WithStreamInterceptor(otelgrpc.StreamClientInterceptor(tracingOpts...))) |
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.
I don't know enough about the grpc wiring to know the implications of this bit... would like an ack from an etcd reviewer
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.
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 part looks good to me.
/assign @wenjiaswe @jingyih |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dashpole, liggitt, logicalhan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This adds tracing for etcd client requests, and propagates context to etcd to connect apiserver spans with spans from etcd-io/etcd#12919.
Part of enhancement: kubernetes/enhancements#647
Special notes for your reviewer:
I followed the pattern used by the EgressLookup config to plumb it through to the etcd client. In order to avoid globals (as requested in the initial tracing review), we pass the TracerProvider via config instead of using the global one. Rather than add etcd options for tracing separately, we copy the tracing-related options into the etcd config after the TracerProvider is initialized.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
For illustration, see the example below:
The top span is the span added in #94942. The bottom span comes from ETCD, and was added in etcd-io/etcd#12919. The middle span is from this PR, and links the top and bottom spans!