-
Notifications
You must be signed in to change notification settings - Fork 18.9k
feat: more context on docker client #47518
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
Conversation
Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
| func (cli *Client) ClientVersion(_ context.Context) string { | ||
| return cli.version | ||
| } |
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.
Doesn't look like we're using it here, so not sure we should add
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 think it might be necessary if we want full trace visibility of the call stack from otel. But I could be wrong here and maybe it's unnecessary as you say
| // ) | ||
| func NewClientWithOpts(ops ...Opt) (*Client, error) { | ||
| func NewClientWithOpts(ctx context.Context, ops ...Opt) (*Client, error) { | ||
| hostURL, err := ParseHostURL(DefaultDockerHost) |
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 will likely be the tricky bit to look at; should a client get a context, or should the context be scoped to an action (like client.MakeSomeAPIRequest). I'm included to say for the client, it would be the latter (per call), and it may be up to the consumer of the client to keep a "global" context if things must be inherited from that. 🤔
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 think this is a similar argument of otel trace visibility over actual context usage (like cancelling io bound tasks).
Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
This is a WIP and a breaking change to the docker client APIs. Most likely required by OTEL for better tracing.
Relates to
- What I did
Add context to more of the docker client function calls.
- How I did it
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)