Skip to content

Conversation

@cpuguy83
Copy link
Member

@cpuguy83 cpuguy83 commented May 7, 2024

This adds trace context propagation over the grpc/ttrpc calls to a shim.

It also adds the otlp plugin to the runc shim so that it will send traces to the configured tracer (which is inherited from containerd's config).
It doesn't look like this is adding any real overhead to the runc shim's memory usage.

@cpuguy83 cpuguy83 force-pushed the propagate_traces_to_shim branch 4 times, most recently from 486b0a5 to 1898361 Compare May 7, 2024 21:34
"github.com/containerd/containerd/v2/cmd/containerd-shim-runc-v2/manager"
_ "github.com/containerd/containerd/v2/cmd/containerd-shim-runc-v2/task/plugin"
"github.com/containerd/containerd/v2/pkg/shim"
_ "github.com/containerd/containerd/v2/pkg/tracing/plugin"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder how this affects the output binary size?

Context: #9233 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like ~2MB larger with this import :(

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine leaving this out (or gated by a tag for debugging purposes?).
Mainly added it to see things working and found it didn't really seem to have an impact in memory usage so I kept it in.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like its easy to hide it with a build tag.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually we should find a way to drop grpc dependency from the runc shim.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gated this by the shim_tracing tag.

@cpuguy83 cpuguy83 force-pushed the propagate_traces_to_shim branch 3 times, most recently from a3d8890 to d3b91c9 Compare May 9, 2024 17:09
@cpuguy83 cpuguy83 force-pushed the propagate_traces_to_shim branch from d3b91c9 to 2c694a1 Compare May 15, 2024 18:56
@cpuguy83 cpuguy83 added this to the 2.0 milestone Jun 27, 2024
@cpuguy83 cpuguy83 added the cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch label Jun 27, 2024
@cpuguy83 cpuguy83 force-pushed the propagate_traces_to_shim branch from 2c694a1 to 36f6bbd Compare June 27, 2024 15:50
@cpuguy83
Copy link
Member Author

Rebased

@cpuguy83 cpuguy83 requested a review from dmcgowan June 27, 2024 16:07
@@ -1,17 +1,625 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woah... go mod tidy did this...

@cpuguy83
Copy link
Member Author

/test pull-containerd-node-e2e


"github.com/containerd/containerd/v2/pkg/atomicfile"
"github.com/containerd/containerd/v2/pkg/dialer"
"github.com/containerd/ttrpc"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Are the imports properly ordered in this file. Not related to this change, but seems like the above packages should be part of the 3rd group

@samuelkarp
Copy link
Member

@cpuguy83 Do you still want to get this in for 2.0? If so it needs a rebase.

@cpuguy83
Copy link
Member Author

Rebased

@mxpv
Copy link
Member

mxpv commented Sep 13, 2024

@cpuguy83 needs another rebase.

@cpuguy83 cpuguy83 force-pushed the propagate_traces_to_shim branch from da71d6d to 3474392 Compare September 16, 2024 17:02
@cpuguy83
Copy link
Member Author

Rebased.

@mxpv
Copy link
Member

mxpv commented Sep 29, 2024

Ah, go.sum outdates pretty quickly.
@samuelkarp do you want to LGTM this before another rebase, so we can merge right after?

This adds trace context propagation over the grpc/ttrpc calls to a shim.

It also adds the otlp plugin to the runc shim so that it will send
traces to the configured tracer (which is inherited from containerd's
config).
It doesn't look like this is adding any real overhead to the runc shim's
memory usage, however it does add 2MB to the binary size.
As such this is gated by a build tag `shim_tracing`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
@cpuguy83
Copy link
Member Author

Rebased.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants