Spin already does some automatic tracing which provides a good out of the box tracing experience for users. It automatically traces service chaining, self requests, outbound requests and even host calls.
However static composition is opaque to the auto tracing in Spin. This means things like like middleware or component dependencies are not nicely auto traced for the user. We should fix that for a better user experience.
Doing this would presumably require some modifications of Wasmtime so that we can hook into the component graph and emit spans at the right locations.
Auto tracing all static composition introduces additional overhead so it should probably be an opt in feature (perhaps granular to the level of opting in per component). To aid in adoption though we could start with templates having it turned on so it is a bit of a opt-out-of-opt-in situation.
Long term we could get fancy and dynamically turn off tracing for calls into components where the overhead of the tracing is too large of a fraction of the total execution time of that component.
Spin already does some automatic tracing which provides a good out of the box tracing experience for users. It automatically traces service chaining, self requests, outbound requests and even host calls.
However static composition is opaque to the auto tracing in Spin. This means things like like middleware or component dependencies are not nicely auto traced for the user. We should fix that for a better user experience.
Doing this would presumably require some modifications of Wasmtime so that we can hook into the component graph and emit spans at the right locations.
Auto tracing all static composition introduces additional overhead so it should probably be an opt in feature (perhaps granular to the level of opting in per component). To aid in adoption though we could start with templates having it turned on so it is a bit of a opt-out-of-opt-in situation.
Long term we could get fancy and dynamically turn off tracing for calls into components where the overhead of the tracing is too large of a fraction of the total execution time of that component.