Enable Go HTTP tracing of registry interactions#5040
Enable Go HTTP tracing of registry interactions#5040dmcgowan merged 1 commit intocontainerd:masterfrom
Conversation
7342933 to
51eb80f
Compare
|
Build succeeded.
|
|
Build succeeded.
|
|
It seems like we should store the tracer in a context that the client creates rather than using a hard-coded tracer? WDYT? |
|
This has the benefit of having more contextual information in the log entries. |
There was a problem hiding this comment.
I agree with @cpuguy83. The default tracer is fine for ctr but assuming all containerd clients need these three events looks a bit odd.
|
@cpuguy83 @kzys yeah, makes sense really. Latest commit drops the integration with server side and just uses |
|
Build succeeded.
|
There was a problem hiding this comment.
Looks like this sort of data would fit well in `WithFields
|
Looks good. The only think i would change would be to factor out the trace client code into a |
Signed-off-by: Phil Estes <[email protected]>
|
@crosbymichael @dmcgowan thanks for the reviews--updated with use of |
|
Build succeeded.
|
| Usage: "pull content and metadata from all platforms", | ||
| }, | ||
| cli.BoolFlag{ | ||
| Name: "trace", |
There was a problem hiding this comment.
Can we name this http-trace by any chance? (because I'm about to add http-dump for debugging http requests/responses)
| } | ||
|
|
||
| if context.Bool("trace") { | ||
| ctx = httptrace.WithClientTrace(ctx, NewDebugClientTrace(ctx)) |
There was a problem hiding this comment.
I think this would be relevant for all registry interactions, not just push/pull.
What do you think about moving this to GetResolver, so all ctr sub commands would benefit from this.
|
@mxpv I suggest just making those updates in a follow up PR if you are already adding more similar functionality. I also have some related metrics I am working around here as well. LGTM on this initial PR. |
Enables a Go embedded feature for tracing certain aspects of HTTP connections; useful for debug of connectivity, DNS, etc. issues with registry interactions.
Example output: