clj-otel

jmv 2025-04-29T16:19:48.206529Z

curious if anyone here is experimenting with core.async flow and has any insights on tracing execution through the flow?

steffan 2025-06-10T22:15:20.039279Z

An update: After experimenting with core.async.flow, I've found that explicit context passing works as expected. I will be looking at adding core.async.flow versions of the microservices examples. It seems bound context is a non-starter, as there's no concept of binding conveyance when working with core.async.flow processes.

🙏🏻 1
steffan 2025-06-10T22:25:05.587729Z

From my experiments, it appears to me core.async.flow favours statically defined channels. The clj-otel core.async examples use short-lived channels, which is a different approach. To work with core.async.flow I've opted to implement lightweight command and response messages that are passed between the processes. With this scheme, the notion of a trace of execution (for say, a server span) is retained. I've yet to implement the examples, but all is going well so far!

steffan 2025-06-10T22:26:54.708789Z

I'd be interested to know how anyone else is working practically with core.async.flow. Is using command/response messages the only sane pattern?

steffan 2025-04-30T08:51:18.779499Z

I've yet to try core.async.flow, but my guess is it should work with either explicit or bound context in the same manner as other async code. Bound context depends on binding conveyance, which I imagine has been implemented for core.async.flow

steffan 2025-07-08T21:23:08.539069Z

@jmv305 I've just pushed an example demonstrating manual instrumentation of a core.async.flow application. This is a new example, rather than a re-implementation of the microservice examples. Using core.async.flow to implement a promise-style application is awkward and probably not a good fit. Instead, the new example is a toy streaming application which better suits core.async.flow. The application uses explicit context passing. https://github.com/steffan-westcott/clj-otel/tree/master/examples/word-stream-app

jmv 2025-07-10T02:17:16.499129Z

this is great, thank you!