-
Notifications
You must be signed in to change notification settings - Fork 6
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
Adding context parameter to span functions #4
Comments
I started to write out a question in the bytecodealliance zulip and felt like I was answering my own questions. Scratch this with a nickel, please:
It strikes me that a free-form string works just fine as a "continuation" or "thread" id for a consuming component. Does anyone have any strong feelings pro- or contra- this? |
My 2p here: Back in the days I was maintaining a PHP tracing library (zipkin-php) and it is single thread in a way but when reactPHP came in, we needed to keep state of the span and not use global states. A context parameters makes lot of sense. Only keeping the IDs in the context is a good idea.
I think the healthiest thing is to use the two ids, probably conflated in a string to represent traceID and spanID.
Host process can create a span (e.g. go middleware) and when we enter into the guest, the span functions should allow users to mutate the spans and or create new spans. The host created spans will hold a context that we can use to create child spans. If no context is provided we can create a new one in the guest and report it to the host.
I think it is very related on how auto-instrumentation gives you access to the context e.g. in Go, some autoinstrumentation work even if you don't propagate the context so if you create a context in wasm and pull the right function to do manual instrumentation in host it should work e.g. https://skywalking.apache.org/docs/skywalking-go/latest/en/advanced-features/manual-apis/toolkit-trace/ |
The Dylibso Observe-SDK implementation relies on the host and guest sharing the same thread & thus, having access to the same thread locals. This allows the host to maintain implicit span state information about the guest.
However, the
wasi-threads
proposal is progressing and runtimes are beginning to add support. This means guests will need to explicitly communicate a context with which to associate span function invocations.Opening an issue to discuss:
span-{enter,exit,tags}
calls?The text was updated successfully, but these errors were encountered: