Skip to content
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

Propagate trace contexts to shims #10186

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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
@@ -24,6 +24,7 @@ import (
"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
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants