-
Notifications
You must be signed in to change notification settings - Fork 109
feat(otel): add context propogation from containerd to the shim #827
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
feat(otel): add context propogation from containerd to the shim #827
Conversation
Signed-off-by: Jiaxiao (mossaka) Zhou <[email protected]>
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
|
||
#[cfg(feature = "opentelemetry")] | ||
tracing::Span::current().set_parent(extract_context(&ctx.metadata)); | ||
|
||
Ok(self.task_create(req)?) | ||
} | ||
|
||
#[cfg_attr(feature = "tracing", tracing::instrument(parent = tracing::Span::current(), skip_all, level = "Info"))] |
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.
Does it need parent=..
here?
Same for the other methods.
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.
what do you mean by parent=...
?
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.
The parent = tracing::Span::current()
inside the tracing::instrument
macro.
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.
okay you got a point. I will clean them up
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.
on a new PR though ^^
Signed-off-by: Jiaxiao (mossaka) Zhou <[email protected]>
Signed-off-by: Jiaxiao (mossaka) Zhou <[email protected]>
Signed-off-by: Jorge Prendes <[email protected]>
this is because we made all the task_{create,...} to be Debug level instead of Info Signed-off-by: Jiaxiao (mossaka) Zhou <[email protected]>
this PR converts the TtrpcContext.metadata to the opentelemetry::Context and use it to propogate the parent span information to each TTRPC handler. The result of this change is that we will be able to preserve the context from containerd Task service:
This PR also marks all the utility functions as "Debug" level tracing instead of "Info". The functions that have "Info" tracing are listed below:
Module:
crates/containerd-shim-wasm/src/sandbox/cli.rs
shim_main_inner
Module:
crates/containerd-shim-wasm/src/sandbox/instance.rs
wait
Module:
crates/containerd-shim-wasm/src/sandbox/shim/cli.rs
new
start_shim
wait
create_task_service
delete_shim
Module:
crates/containerd-shim-wasm/src/sandbox/shim/local.rs
create
start
kill
delete
wait
connect
state
shutdown
stats
Module:
crates/containerd-shim-wasm/src/sys/unix/container/instance.rs
new
start
kill
delete
wait_timeout