Managing spans within a stream
Tracing within a stream: I have a stream of events, among them "open" and "close" as well as other events. I can receive each event an arbitrary number of times in the stream, but "open" and "close" always alternate. I want to create a span when I receive "open" and end it when I receive "close", Any other events received within that span should be logged as events on that span. I have a solution now:
but
but
Effect.log doesn't add events to this span while it's active. This span also isn't considered the "current" span in the span context, so any side effects in the stream during this span aren't children of this span, either. Is there a way to do what I'm asking without a ton of manual and explicit span management?