pedestal

hlship 2024-04-01T18:20:04.598329Z

An idea I had: what if, after each interceptor executes, we could (when tracing) log which interceptor executed and what changes to the context occurred?

🆒 4
souenzzo 2024-04-01T20:50:03.346839Z

I've needed this a few times

2024-04-01T23:44:27.400499Z

Yes, if an outer interceptor or routing map could stick something into the context that meant "please log the interceptor transitions for this request" [which could even be retroactive to any prior interceptors that had already handled it], that would be super! As to the level of detail - I would be happy with the minimum, i.e., name of interceptor and whether it made any changes at all. Once the systemic logging has brought me up to speed on which interceptors are relevant, then I can expressly log further details myself. In other words, it would be a matter of diminishing returns for Pedestal to try to figure out the helpful level of detail.

hlship 2024-04-01T23:46:26.698009Z

I’ve also been thinking about a event based system, where events would be broadcast (i..e, a function would be invoked) after each interceptor’s execution, passing before-and-after context map (possibly, with some internal-use-only keys dissoc’ed). What I described above could be built on top of that, though not necessarily phill’s suggestion (as it is retroactive and stateful).

souenzzo 2024-04-02T00:01:19.347189Z

A function: tap> Maybe this can be part of "interceptor compiling" step.

hlship 2024-04-02T02:27:06.254839Z

I’ve felt that tap> should be reserved for the application to do as it sees fit; the moment we have libraries/frameworks using tap> is the moment we start having issues with conflicting things being tap-ed.

jmv 2024-04-02T03:39:41.973899Z

Will there be otel trace spans for these events? That seems like it could be useful and would remove a lot of the manual span creation in my apps.

hlship 2024-04-02T04:32:32.681829Z

I don’t have a detailed design. That being said, the challenge is knowing when to stop a started span. Also, spans that last microseconds aren’t useful; just those that do I/o and can block for an appreciable amount of time.

hlship 2024-04-02T04:33:17.001549Z

So span for each interceptor is not useful and will generate a lot of noise.

jmv 2024-04-02T04:43:21.602929Z

Good point

Ludger Solbach 2024-04-01T21:52:03.830749Z

interceptor interceptors 😜. But it could be helpful in debugging.